August 1, 2003 at 7:20 am
I have some 60 empty tables that have Identity = yes on the PK. Into these tables, I need to import data from corresponding, but not identical Access tables (don't ask) that already have PK values that obviously, I'd like to preserve.
My thought was to turn off Identity for the SQL tables, import the data, then restore the Identity setting. I thought this would be simple enough using TSQL using an ALTER TABLE ALTER COLUMN statement, but I can't quite seem to figure out how to do this.
Anyon know how I can do this, or a better way to import the data?
Cheers,
dj
August 1, 2003 at 7:29 am
Use SET IDENTITY_INSERT to allow explicit values to be inserted into the identity column of a table.
August 1, 2003 at 7:33 am
Thanks -
I thought of that, but this can only be applied to one table at a given time.
I may have to fall back to this approach, but I was hoping to do all 60 tables at a time. If possible.
August 4, 2003 at 12:12 pm
Have you tried setting the import up in a DTS package? I believe it is the fourth tab on the transformation object that allows you to set the IDENTITY_INSERT on.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply