May 27, 2017 at 6:58 am
Hi Experts,
I am trying to export /add table rows (table1) to another table (table2) . Table2 has an identity column , is there any approach that table1 rows can be transferred to table2 with out using identity insert ?
PS: Identity column is a primary key.
May 27, 2017 at 7:00 am
If you want to specify the values for the identity column, you need to set IDENTITY_INSERT on for that table. If you want the identity to automatically assign the values, then you can insert without setting that on.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 27, 2017 at 7:23 am
Thanks for the reply.
Realized that using non-identity column list in insert into statement will make identity column to auto increment.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply