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
 General SQL Server Forums
 New to SQL Server Programming
 Serial number assignment

Author  Topic 

gfaryd
Starting Member

27 Posts

Posted - 2010-09-30 : 09:21:30
sql 2000 question

i have following table structure

create table my_tab(pname varchar(35), fname varchar(35), age varchar(10))

table contains more than 20000 rows

i have added a column serial_no.

i want to assign serial numbers (starting from 1) in table how to do that. i dont want an identity column.

regards,

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-30 : 09:31:46
why not?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-30 : 11:54:11
best way is to make it identity column. If not, you need to use ROW_NUMBER() function. But for that you should be using SQL 2005 or later

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-10-01 : 06:09:32
If you dont want to use an identity column, do numbering in the front end application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -