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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Related to Dup

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-10-31 : 07:50:12
manikandan writes "Related to duplicate rows in table

Is there any substitute in sql server for rowid in oracle.

“I have a table with out any primary key.
And have a two identical rows.
I have to delete one row.
How can I do this in sql server2000

Hope some one will help me.

Thanx and regards
manikandan"

dsdeming

479 Posts

Posted - 2003-10-31 : 08:10:35
There is no SQL Server equivalent to rowid. Your best bet might to

SELECT DISTINCT *
INTO temptable
FROM sourcetable
WHERE whatever filters down to just the 2 rows in question

DELETE FROM sourcetable
WHERE whatever filters down to just the 2 rows in question

INSERT INTO sourcetable
SELECT * FROM temptabe


Dennis
Go to Top of Page
   

- Advertisement -