Created
June 8, 2010 09:31
-
-
Save chaliy/429815 to your computer and use it in GitHub Desktop.
Solution to remove duples from SQL table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Stupid solution to remove duples from sql table... | |
DECLARE @temp TABLE | |
( | |
[Col1] [uniqueidentifier] NOT NULL, | |
[Col2] [uniqueidentifier] NOT NULL | |
) | |
INSERT INTO @temp | |
SELECT DISTINCT [Col1] ,[Col2] | |
FROM TargetTable | |
DELETE FROM TargetTable | |
INSERT INTO TargetTable SELECT * FROM @temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment