Using Column Sets for Sparsely Populated Columns
SQL Server has a little-known feature called Column Sets that is very useful when dealing with large numbers of sparse columns. Sparse columns are useful when you need a table with many columns where the…
Build a CREATE TABLE statement from the output of a Stored Procedure with dm_exec_describe_first_result_set
Day-to-day database administration and development on SQL Server will often require creating a temporary table to hold the output of some stored procedure. The code below uses the dm_exec_describe_first_result_set 1 system dynamic management function, or…
Efficiently Update Data from OLTP to OLAP
OLTP to OLAP: Acronym Time! Online Transaction Processing, or OLTP, serves data to clients for line-of-business applications, enabling core business functionality. Online Analytical Processing, or OLAP, consists of analyzing OLTP data with the intent of…
Disabled Active Directory Accounts in T-SQL
SQL Server, by default, uses Windows Authentication to provide integrated Active Directory authentication to users. This makes it extremely easy to setup new users; you only need to know the Active Directory account name, or…
Could not find database ‘x’, or why good object names are important.
SQL Server provides a method for specifying object names that contain special characters – you simply wrap the name in square brackets, as in [This-Is-A-Valid_$_ObjectName]. However, simply because you can do a thing, doesn’t mean…
SQL Server Agent Job Activity
SQL Server Agent provides a graphical user interface to inspect the status of agent jobs. The Job Activity Monitor looks like: However, if you want to programmatically obtain the detail about running jobs, including details…