Category Archives: T-SQL

  1. Updating a view

    Leave a comment

    September 30, 2015 by Kenneth Fisher

    I was recently asked how to update views. Specifically the question was about using triggers to update a view. So …
    Continue reading

  2. “sql_handle” is not a recognized table hints option.

    Leave a comment

    September 23, 2015 by Kenneth Fisher

    I’ve you’ve run a query similar to the following: And gotten an error similar to: Msg 321, Level 15, State …
    Continue reading

  3. Using @@ROWCOUNT can be a bit tricky


    September 16, 2015 by Kenneth Fisher

    @@ROWCOUNT is a very useful system variable that returns the number of rows read/affected by the previous statement. It’s frequently …
    Continue reading

  4. Finding the worst running query in a stored procedure


    September 10, 2015 by Kenneth Fisher

    The other day I was asked to tune a stored procedure. Not exactly an uncommon task, but I worked something …
    Continue reading

  5. Pulling data from the error log


    August 17, 2015 by Kenneth Fisher

    The other day I was asked to pull a list of errors from the SQL Server log into a table …
    Continue reading

  6. Getting and storing a high precision datetime


    August 13, 2015 by Kenneth Fisher

    Earlier today I was working on a project where I was recording some time stamps. In order to get as …
    Continue reading

  7. A pattern to match correctly on a value or a NULL


    August 5, 2015 by Kenneth Fisher

    As you may have noticed if you read my blog I learn a lot from trolling various forums. In this …
    Continue reading

  8. Filtered Index restrictions and Kendra Little’s Index Quiz

    Leave a comment

    July 20, 2015 by Kenneth Fisher

    A few weeks ago I saw a tweet about Kendra Little’s (b/t) new SQL Server Quizzes. Of course I had …
    Continue reading

  9. Blocking and deadlocking on purpose

    Leave a comment

    July 1, 2015 by Kenneth Fisher

    Blocking and deadlocking are not things you typically want to do deliberately. But sometimes you need to test error handling …
    Continue reading

  10. Which user function do I use?

    Leave a comment

    June 24, 2015 by Kenneth Fisher

    Earlier this week I was scripting out a table with some legacy columns (InsertDate and InsertBy for example). If you …
    Continue reading


Get every new post delivered to your Inbox.

Join 806 other followers