Category Archives: T-SQL

  1. Finding, disabling and enabling foreign keys


    June 29, 2016 by Kenneth Fisher

    Foreign keys are a classic method of enforcing RI (Referential Integrity). Unfortunately though, they can get in the way if …
    Continue reading

  2. Perfectly Placed Parentheses


    June 27, 2016 by Kenneth Fisher

    Like many other programming languages T-SQL uses parentheses () for a number of tasks. To help determine precedence, function calls …
    Continue reading

  3. Help! My backup file has doubled in size.


    June 16, 2016 by Kenneth Fisher

    Help! I backed up my database yesterday and the backup file was about 200MB but today it’s closer to 400! …
    Continue reading

  4. Comparing the contents of two tables Redux

    Leave a comment

    June 8, 2016 by Kenneth Fisher

    I did a post the other day on comparing two tables. It was meant as a general overview but I …
    Continue reading

  5. Using LEN wrong.


    June 2, 2016 by Kenneth Fisher

    I was reading someone’s question the other day on StackExchange and while the existing comments/questions solved the OP’s (original poster) …
    Continue reading

  6. Master_Views: master_objects, master_tables, etc

    Leave a comment

    May 23, 2016 by Kenneth Fisher

    There is a highly useful system view called sys.master_files. If you’ve never encountered it before it returns a list of …
    Continue reading

  7. Comparing the contents of two tables


    May 12, 2016 by Kenneth Fisher

    I’ve been working on tuning a query for the last week and I’ve had to make several changes to the …
    Continue reading

  8. How do I rename a column?


    April 18, 2016 by Kenneth Fisher

    Everyone makes mistakes right? And sometimes you create an object and decide later that you messed up and need to …
    Continue reading

  9. Modulo!


    April 14, 2016 by Kenneth Fisher

    I love this somewhat obscure mathematical operator. All it does is return the remainder of a division statement but even …
    Continue reading

  10. Name the schema when you create an object (or else)


    April 6, 2016 by Kenneth Fisher

    This is one of those frequently ignored best practices. When you create an object, specify the schema where it will …
    Continue reading

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,222 other followers

Follow me on Twitter

ToadWorld Pro of the Month November 2013

Get every new post delivered to your Inbox.

Join 1,222 other followers