Tag Archives: SQLNewBlogger

Rename a Database: #SQLNewBlogger

I had someone ask me how to rename a SQL Server database recently. They were doing some development work and wanted to rename databases to test an application. I thought I remembered, but in this post, I show I learned … Continue reading

Posted in Blog | Tagged , , | 1 Comment

Counting Groups with Window Functions: #SQLNewBlogger

I looked at row_number() in a previous post. Now I want to build on that and do some counting of rows with COUNT() and the OVER clause. I’ll show how this differs a bit from a normal aggregate. Another post … Continue reading

Posted in Blog | Tagged , , , | 1 Comment

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

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