Tag Archives: T-SQL

Adding Row Numbers to a Query: #SQLNewBlogger

I realized that I hadn’t done much blogging on Window functions in T-SQL, and I’ve done a few presentations, so I decided to round out my blog a bit. This post will start with the ROW_NUMBER() function as a gentle … Continue reading

Posted in Blog | Tagged , , , | 5 Comments

Enabling an Index: #SQLNewBlogger

I don’t do a lot of work with disabled index, but I learned how to re-enable one today, which was a surprise to me. This short post covers how this works. The Scenario Imagine that you have an index on … Continue reading

Posted in Blog | Tagged , , , | Comments Off on Enabling an Index: #SQLNewBlogger

Comparing an Old Running Total to Window Functions

Often I see running totals that are written in SQL using a variety of techniques. Many pieces of code were written in pre-2012 techniques, prior to window functions being introduced. After SQL Server 2012, we had better ways to write … Continue reading

Posted in Blog | Tagged , , | 2 Comments

Bad Stored Procedures

I don’t see a lot of SQL at The Daily WTF, but this one was great. It’s a stored procedure that was likely just converted from embedded code, as noted by the poster. It’s a strange set of code, that … Continue reading

Posted in Editorial | Tagged | Comments Off on Bad Stored Procedures