To delete duplicate records using MSSQL you can use the following snippet.
The table must have identity column, which will be used to identify the duplicate records.
DELETE FROM TableName WHERE ID NOT IN ( SELECT MAX(ID) FROM TableName GROUP BY ColumnWithDuplicatesName)
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…
RT @CodeSnippetsNET: How to delete duplicate records using #MSSQL http://t.co/jle4fgSYsX #sql #tsql #sqlserver #codesnippets #coding #dev #…