Code Snippets

Delete duplicates from a table using TSQL

3.333335
Your rating: None Average: 3.3 (3 votes)

Even if you have variable number of duplicates, this script will delete them all. It uses SQL 2005's new TOP feature in DELETE clause. The () are required now, although still works without them in SELECT statements.

Get filename and path into two different variables

3.666665
Your rating: None Average: 3.7 (3 votes)