No Picture

sp_executesql with output parameters

January 22, 2015 Andy 2

One of my coworkers asked me about output parameters from dynamic SQL today. I pointed him at sp_executesql, which allows for passing parameters into or out of dynamic SQL. The syntax can be confusing at first blush (especially for a new DBA or developer), but … [Read More]

Formatting HTML emails in SQL

November 26, 2014 Andy 1

When I am writing monitoring/alerting stored procedures for my SQL Servers, its important to have those alerts be well-formatted. I like to minimize the amount of time I spend sorting through emails & alerts, and part of that is making sure that I can determine … [Read More]

sp_get_basetable_list

May 22, 2014 Andy 0

At work, we make extensive use of views & synonyms. The reasons are complex (and fodder for another post), but here’s a simplified example: Pricing data is updated multiple times per day, and we want to keep multiple generations of the pricing table online. By … [Read More]

What’s the use case of disabling an index?

October 14, 2000 Andy 0

Question I just learned that indexes can be disabled on a table. Even the clustered index can be disabled. After that, users can’t access the index or the data if clustered index. When will we disable an index? I just don’t understand the use case. … [Read More]