Quantcast
Channel: ColdFusion Joe
Viewing all articles
Browse latest Browse all 26

Find Duplicates in MSSQL

$
0
0
Find duplicate entries in MS SQL table columns. Need to see if you have 2 or more duplicate entries in your table? Want to find out if the key is really unique and there are not multiples? Simple! SELECT [ID], COUNT([TaskID])as NumberOfDups FROM [dbo].[MyBigTable] GROUP BY ID,[TaskID] HAVING (COUNT([TaskID]) > 1 ) ID = the identifier, could be a name or whatever
TaskID = looking for duplicates of this

Viewing all articles
Browse latest Browse all 26

Trending Articles