Technical Blog

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 in: SQL

» Permalink
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 in: SQL

» Permalink
DateTime formatting demonstration utilizing a multitude of temporal data formats available in SQL Server 2005/2008.

[Read more...]

Posted in: SQL

» Permalink
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 in: SQL

» Permalink
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 in: SQL

» Permalink
Page 1 of 2First   Previous   [1]  2  Next   Last