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 is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?
Where is trigger in sql server?
Can I disable or restrict ssrs export formats (rendering formats)?
What are the differences between left join and inner join in sql server?
How to recreate an existing index in ms sql server?
Will the writetext statement activate a trigger?
Why transaction is important?
What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
but what if you have to create a database with two filegroups, one on drive c and the other on drive d with log on drive e with an initial size of 600 mb and with a growth factor of 15%? : Sql server database administration
What are the steps to take to improve performance of a poor performing query? : sql server database administration
What are the advantages of using a stored procedure?
Explain the flow of creating a cube? : sql server analysis services, ssas
How do you migrate data from mssql server to azure?
What are diverse clauses that form a part of sql?
What is checkpoint in sql server?