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)
 Row id in SQL Server 2000

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2002-08-28 : 04:26:48
Is there a option for row id in sql 2k? (like in oracle..)
(In foxpro we have got recno()...)...please give some examples..

Thanks in advance
regards


smccreadie
Aged Yak Warrior

505 Posts

Posted - 2002-08-28 : 04:52:30
There is no row id in SQL Server because the engine determines the optimal way to store rows.

You need to use an identity field or another key to "number" the records.

See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6195 for more details.



Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-08-28 : 04:53:44
It does have a row id but it's not easily accessible (and may change).
If you need it put an identity or guid on the table or calculate when you insert records.

==========================================
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.
Go to Top of Page
   

- Advertisement -