Better T-SQL cursor loops
I'm going to begin by saying that you should always use set based operations instead of loops when set based operators are an option. If you don't understand that please read this blog from...
View ArticleKill and Shutdown in SQL Server
I've recently had some trouble with SQL Server Integration Services behaving badly. SSIS manages its own memory use, and ordinarily does a good job. By throttling inputs SSIS can run vast amounts of...
View ArticleWhy is CROSS APPLY so slow? Part 2: Repeating I/O
This is the second post in a series on the performance of functions in SQL Server. The first post describes call overhead. The real killer in T-SQL functions is that any SELECT statement in the...
View ArticleTesting in SQL Server – Count all rows from multiple tables
Here's a quick and easy script I find myself using often to count all rows across multiple tables, so I thought I would share. It uses SQL to write, then execute SQL, performing a count(*) across all...
View ArticleMy New Favourite Shortcut
Recently I've been doing a bit of development work in the MS SQL space and one of the frustrations I had was (my) inability to quickly show the schema information for a specific table within Microsoft...
View ArticleCopying SSIS Packages to a New Project
As is common in a data warehouse solution, over time the primary SSIS Project has grown dramatically as new packages have been added and a definable split in the function of those packages has...
View ArticleThe Exec Exec trick
SQL Server's Transact SQL has some weird constraints. One of which is that certain statements must be the first one in their batch. This causes all kinds of head-aches for dynamic SQL. I start with a...
View ArticleHow to Write Dynamic SQL Well
I do a lot of work in Microsoft SQL Server's Transact SQL stored procedures. Almost everything that I write performs a single operation on a series of tables: for example computes a specific aggregate...
View ArticleHow to use Liquibase to migrate MS SQL Server to Oracle
I’m a certified SQL Server DBA, a certified Oracle DBA, and I’ve used liquibase before, so I thought that using liquibase to migrate a schema definition from SQL Server to Oracle was going to be...
View Article