Thursday, March 22, 2012

deleting duplicate records

dear friends,
suppose i've one table, it has only to rows.the two rows are are same as it is.how can i delete one row from that table?

thank you verymuchSELECT DISTINCT *
INTO #HOLDING
FROM >your table<
GO
TRUNCATE TABLE >your table<
GO
INSERT >your table<
SELECT *
FROM #HOLDING
GO
DROP TABLE #HOLDING
GO|||you can add another column of type bigint make it auto increment by setting Identity properties to Yes. then you can mannually delete the row :)

Quote:

Originally Posted by vinod

dear friends,
suppose i've one table, it has only to rows.the two rows are are same as it is.how can i delete one row from that table?

thank you verymuch

sql

No comments:

Post a Comment