Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-04-10 : 09:38:38
|
| Sam writes "See, i need to delete all the rows except one from a table in Sql Server. The table may or may not have any unique key,but the problem is i dont know the structure of the table...just the name of the table is given. Thers no such restriction on the row which should be left after deletion. I need that Sql query...Reply soon... Thanks.." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-04-10 : 09:46:03
|
| declare @i intselect @i = count(*) - 1 from tblset rowcount @idelete tblset rowcount 0==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|