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
What command is used to create a database in the sql server and how?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
What is resource governor?
How many columns can exist together per table?
How to generate create table script on an existing table in ms sql server?
Can the query output be sorted by multiple columns in ms sql server?
What do you understand by recursive stored procedures?
What are triggers in ms sql server?
What is an example of a foreign key?
Explain the categories of stored procedure i.e. System stored procedure, local stored procedure, temporary stored procedure, extended stored procedure, remote stored procedure?
Can a table have 2 primary keys?
System requirements for sql server 2005 express edition?
What is a virtual table in sql?
Can a database be shrunk to 0 bytes, if not, why?
What are the acid properties?