Results 1 to 3 of 3

Thread: Autonumber + MSDE

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    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

  2. #2
    Addicted Member
    Join Date
    Mar 2003
    Location
    Minneapolis, MN
    Posts
    151
    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.

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Thanks you so much.
    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
  •  



Click Here to Expand Forum to Full Width