petercon
03-13-2004, 12:54 PM
I am trying to back up and restore a table with an identity column
without losing the value of that column.
I have copied the data into a back up table using:
'insert into tblmy_back
select * from tblmy'
tblmy_back does not have an identity column, this preserves the value.
After dropping and redefining tblmy without the identity column I load it with 'insert into tblmy select * from tblmy_back'
I cannot alter the column back to an identity column.
How can I get around this problem?
Answer: from asp.net forum at msn
set identity_insert tblcalculation on
before reloading with :
insert into tblmy_back
select * from tblmy
HPC
without losing the value of that column.
I have copied the data into a back up table using:
'insert into tblmy_back
select * from tblmy'
tblmy_back does not have an identity column, this preserves the value.
After dropping and redefining tblmy without the identity column I load it with 'insert into tblmy select * from tblmy_back'
I cannot alter the column back to an identity column.
How can I get around this problem?
Answer: from asp.net forum at msn
set identity_insert tblcalculation on
before reloading with :
insert into tblmy_back
select * from tblmy
HPC