|
-
Apr 28th, 2003, 04:00 PM
#1
Thread Starter
Frenzied Member
Autonumber + MSDE
Hey,
I have to take a record from an Access table and insert it into a MSDE table. The catch is that I have to preserve the AutoNumber field's value. If I upsize it from Access, it does it. However, I need to create a conversion program as this will be sent out to customers.
Thanks,
Don't anthropomorphize computers -- they hate it
-
Apr 29th, 2003, 06:58 AM
#2
Addicted Member
Are you writting the conversion app?
The SQL Syntax for this is:
Code:
SET IDENTITY_INSERT <tablename> ON
--Your Insert SQL Query Goes Here.
--The below is one possible example.
INSERT INTO <tablename> (<field1>, <field2>, ...)
VALUES (<value1>, <value2>, ...)
SET IDENTITY_INSERT <tablename> OFF
Note that IDENTITY_INSERT can be active for only one table at a time.
It can be issued as a separate statement (meaning that you don't have to immediately run a query after turning it on). It remains active until turned off. Make sure that you always turn it off when done.
-
Apr 29th, 2003, 10:15 AM
#3
Thread Starter
Frenzied Member
Don't anthropomorphize computers -- they hate it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|