Entries for the 'SQL' Category
Code snippet demonstrating a way to delete duplicate rows in a SQL Server table. This methodology only works on tables with an identity column.
[Read more...]
Posted by Derek Trauger on Tuesday, February 09, 2010
In the event where bulk inserts are required or validation of a constraint is not necessary, disabling and enabling foreign keys and/or check constraints can be extremely useful.
[Read more...]
Posted by Derek Trauger on Wednesday, January 06, 2010
DateTime formatting demonstration utilizing a multitude of temporal data formats available in SQL Server 2005/2008.
[Read more...]
Posted by Derek Trauger on Wednesday, December 30, 2009
From time to time the event where objects need to be cleared from a database without dropping the entire database and re-creating it may arise. This script works to drop all user defined data types, tables, foreign keys, views, functions, constraints and stored procedures from the database executed against. This script may need to be extended to include any object types not listed that may reside within your database.
[Read more...]
Posted by Derek Trauger on Tuesday, November 03, 2009
On many occasions rows may be inserted utilizing an identity column as the primary key, in many of these cases it may be necessary to capture the newly auto-generated value. The following article will describe three such approaches: @@IDENTITY, SCOPE_IDENTITY(), and IDENT_CURRENT().
[Read more...]
Posted by Derek Trauger on Thursday, June 11, 2009
|
|