How do I override the identity
column in MSSQL? I tried :
SET IDENTITY_INSERT GeoCountry ON
UPDATE GeoCountry SET CountryID = 18 WHERE C
You could also do this in one statement using delete into, this has the benefit of eliminating any error copying/moving the row data, for example
set identity_insert [dbo].[MyTableName] on
delete from [dbo].[MyTableName]
output
,
[deleted].[Col1],
[deleted].[Col2],
[deleted].[Col3],
into
[dbo].[MyTableName] (
[IdColumnName],
[Col1],
[Col2],
[Col3])
where
[IdColumnName]=
set identity_insert [dbo].[MyTableName] off