May 27, 2011

How to delete duplicate records from a table in sql server

It is not possible to insert duplicate records in a table if using primary key constraints.But in relational database when foreign key is used it is possible that a duplicate records can insert in foreign key column.So solving that type of condition use that statement.
 Example:
            

set rowcount 1
delete from <table_name>
where <column_name>=value and <column_name>=value

No comments:

Post a Comment