How To delete duplicate record from a particular table?

Answer Posted / g2

create table Table1(trowid int not null, tname varchar(100))

insert into table1(trowid, tname) values(1, 'G2')
go 100

declare @row int;
set @row= (select count(*) from table1)
set @row=@row-1
set rowcount @row
delete from table1 -- You can put here conditions with all
the columns also
set rowcount 0
go

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between DDL, DML and DCL in SQL?

754


How will you make an attribute not process? : sql server analysis services, ssas

582


How to create a simple table to test triggers in ms sql server?

505


How check triggers in sql server?

517


What is difference between standardization and normalization?

528






How to list all user defined functions in the current database?

512


How to connect a database with sql express.?

564


What is RMS migrations?

1698


SQL Server Architecture ?

1921


How to get a list of columns in a view using the "sp_columns" stored procedure?

612


List out some of the requirements to set up a sql server failover cluster?

543


What is the exact numeric data type in sql?

547


What is plan freezing?

580


Explain differentiate between a having clause and a where clause?

508


How to define the name and server for a new dsn?

545