This category contains 13 posts

T-SQL INT to Time

I recently made the wise or not so wise decision to convert all the TimeID columns in a new data warehouse project from Int  to Time data types. This was done because the ETL was going to calculate the UTC dates and times based on these values, which is obviously easier to do if they … Continue reading

Batch Large Deletes

A common issue with large DML operations, like deletes, is the impact on system resources especially tempdb. Even in simple mode large delete operations can have a significant impact on your database & tempdb resources. I often use the following code to batch my delete operations utilizing the t-sql windowing function capabilities (You could always … Continue reading

A stored procedure "best practices" checklist

When developing stored procedures, there seems to be a lot of emphasis on “get it done fast.” Which means type all lower case, pay little attention to formatting, and sometimes throw best practices out the window. Personally, I would rather front-load my development time; I think that the costs I pay in initial development far … Continue reading

T-SQL performance anti-patterns. Part 1 – Data Types

What you don’t know could hurt your query performance. I will present a seven part series on the most common T-SQL performance anti-patterns. Part 1 – Data Types, Part 2 – Using Functions, Part 3 – Multi-Statement UDFs, Part 4 – Dirty Reads, Part 5 – Query Hints, Part 6 – The Dreaded Cursor, Part … Continue reading