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)
 update of ID column

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2005-04-08 : 08:51:06
Guys,
I have a ID column in table of 500 rows, right now it is null, I want to update the column with unique fields
starting from 1 to 500. The purpose of this field is to set it as primary key(by turning on the identity) eventaully when
these rows are updated.

any suggestions/inputs of how the update process would help

Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-04-08 : 09:23:45

Drop that column and create new column with the name ID having identity property

Madhivanan

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

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2005-04-08 : 09:36:29
I want to update the ID column to unique values from 1 to 500 before turning the identity on for the new inserts.

Thanks
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-04-08 : 16:48:05
scelamko,
what's wrong with madhivanan's solution ?

rockmoose
Go to Top of Page

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2005-04-08 : 18:52:37
Sorry it does work with the above solution

Thanks
Go to Top of Page
   

- Advertisement -