SQL Job History

Manually retrieve the history for a job in SQL Server.

Check for existence of temp table

MSSQL syntax for checking if a temporary table exists.

Merge - Conditionally Insert, Update, or Delete

Conditionally Insert, Update, or Delete in one SQL statement and even output the results.

Copy Table

A simple way to copy tables in SQL.

Deleting Duplicates

An example of how to easily delete duplicates from a table in MS SQL.

Deactivate Autorecovery

The autorecovery feature in SQL Management Studio was driving me crazy so I found a way to turn it off.

MS SQL "Stuff" Keyword

The "Stuff" keyword in MS SQL lets you stick multiple subquery results into a single string. Nice.

MS SQL Cursor

Here's an example of how to create a simple T-SQL cursor to loop through data in mssql.

MS SQL Row Count

A quick way to count the rows in every table in a mssql database.