Recursive SQL query for parent child data

Posted in MSSQL on February 3rd, 2010 by phoenixdigital

Powerful scripts to retrieve parent child data in a few simple calls
http://www.vbforums.com/showthread.php?t=366078

Tags: , , , ,

MSSQL Scripts and Programming

Posted in MSSQL on November 18th, 2009 by phoenixdigital

These hints will allow you to create MSSQL scripts to performs updates to remote databases. The following examples utilise the loops and temporary tables with a more complex example at the end bringing them all together.
Read more »

Tags: , , , , ,

Kill SQL Processes in MSSQL

Posted in MSSQL on September 8th, 2009 by phoenixdigital

When trying to restore a database from a backup or perform any operation that requires full access you may be warned there are still users connected. To remove these processes you will need to go to the activity monitor of SQL Server Management Studio.
Read more »

Tags: , , ,

MSSQL Turn off Identity and Constraint Check

Posted in MSSQL on July 27th, 2009 by phoenixdigital

When inserting raw data into a Microsoft SQL database you may need to turn off the primary key check and any other constraints just so you can get your data into the system. The following commands will achieve this.

SET IDENTITY_INSERT [TableName] ON;
ALTER TABLE [TableName] NOCHECK CONSTRAINT all;

To restore all checks back to the way they were

SET IDENTITY_INSERT [TableName] OFF;
ALTER TABLE [TableName] CHECK CONSTRAINT all;

Tags: , , ,