Click here to monitor SSC

Nigel Rivett

Nigel Rivett

Split csv entries from a column in a table


This is all in a single query without having to create a function. The separator is in a cte so doesn’t need to be declared separately. For longer separators include the length in this cte and use it for the length adjustments in the query. create table #a (rowid int, csvstring varchar(100)) insert #a select […]

13 December 2013 12:26 pm by
Nigel Rivett

Generate a merge statement from table structure


/* This code generates a merge statement joining on the natural key and checking all other columns to see if they have changed. The full version deals with type 2 processing and an audit trail but this version is useful. Just the insert or update part is handy too.     Change the table at […]

12 November 2013 5:00 pm by
Nigel Rivett

Search SSIS packages for table/column references


A lot of companies now use TFS or some other system and keep all their packages in a single project. This means that a copy of all the packages will end up on your local disk. There is major failing with SSIS that it is sometimes quite difficult to find what a package is actually […]

7 November 2013 12:26 pm by
Nigel Rivett

Powershell – script all objects on all databases to files

1 comment

<# This simple PowerShell routine scripts out all the user-defined functions, stored procedures, tables and views in all the databases on the server that you specify, to the path that you specify. SMO must be installed on the machine (it happens if SSMS is installed) To run – set the servername and path Open a […]

18 October 2013 9:03 am by
Nigel Rivett

New way to use up time


Hello all, My first attempt at a blog. Well second actually – I’ve just created another one for myself at Anyway I’m trying to concentrate a bit more on contributing to this fine site. I recently published an article on identities – it contains info that I would expect most people to know already […]

20 May 2008 11:08 pm by

Blog archive