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 |
chriztoph
Posting Yak Master
184 Posts |
Posted - 2009-07-20 : 00:54:50
|
Hi!i have this 1.2gig(1 table only) i imported from text file then i don't have the identity number..now,i want to put a an ID field in it..how can i make it to have the identity ID to make sequencial? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-20 : 01:01:55
|
[code]alter table <table name> add [ID] int identity(1,1)[/code]It is sequential. Or do you mean you want the ID to be in a specific sequence of your choice ? KH[spoiler]Time is always against us[/spoiler] |
|
|
chriztoph
Posting Yak Master
184 Posts |
Posted - 2009-07-20 : 01:09:22
|
the normal sequential ID.. 1,2,3,4,5,n.....like that..what if i already had the field before i imported the records? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-20 : 01:28:55
|
you mean there are values in the field and you want to continue the sequence no from the max of the seq no onwards ? KH[spoiler]Time is always against us[/spoiler] |
|
|
chriztoph
Posting Yak Master
184 Posts |
Posted - 2009-07-20 : 01:30:56
|
none.the entire ID field has null value.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-20 : 01:35:48
|
then just drop that column and add it again with identity KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|
|
|