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 |
|
kathyc2003
Starting Member
15 Posts |
Posted - 2007-06-22 : 09:19:34
|
| Hello,I have a field in my table called "MyNewCounter", where the data type is int.Unfortunately I set the identity field to "No" insteadof "Yes" on this field.Since this time a few thousand records were importedin and this field is now set to a value of null for all records.When I tried to change the identity to "Yes" and savethe table, I get an error indicating that the field can notcontain a null value.If I populated this field with numeric values, would thiscorrect my issue? and if so, what SQL command wouldI use to set the field value starting at 1 to incrementfor each existing record? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-06-22 : 10:11:18
|
| drop the column and add a new identity column which will be automatically populated.The old dropped column will probably still take up space but that shouldn't matter.==========================================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. |
 |
|
|
|
|
|