Archive for June, 2007

Friday, June 29th, 2007

Massive In-Place Delete

My latest debacle loading this massive table has to do with removing duplicates before I try adding a primary key to the table. I had to restart the load process a couple times before I finally settled into a method that worked well. (Running multilpe instances of DTExec on different subsets of the source data, [...]

No Comments » - Posted in SQL Server, SQL Tricks by Shane

Thursday, June 28th, 2007

BULK UPDATE

Dear Shane,
Next time trust me. SELECT INTO is always faster than UPDATE when you’re talking about updating the entire table. Even if the table has three NVARCHAR(MAX) fields and you’re only updating one 4 byte INT column.
Rather than run an update for 1hr 6min before you decide to cancel said query and trigger a 2hr [...]

No Comments » - Posted in SQL Server, SQL Tricks by Shane

Thursday, June 28th, 2007

Favorite New SQL 2005 Syntax

When I was working with Oracle, I got hooked on using MINUS and INTERSECT. Well, it turns out that Microsoft implemented these functions in a slightly different way in SQL 2005.
Jeff Smith lays out a nice example here.

No Comments » - Posted in Other, SQL Server by Shane