Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004

    Unanswered: Need to increment column in 3rd party db

    I have a 3rd party db where I need to insert records into one of the tables. The id column needs to increment and it is not defined as an identity column.

    I'm looking for suggestions on how to handle this.

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 17
    Monkeying with a third party system is one of the best ways to break it. Any chance of getting help from the guys who designed the system in the first place?

    EDIT: Fixed a typo. Yeah. I am anal like that.

  3. #3
    Join Date
    Jan 2004
    It is a point of sale system and they do not provide support for this kind of thing.

    I've been monkeying around with this system for several years. We are upgrading to the latest version and they switched the back end from Access to SQL Server. I had this working in Access but this particular function doesn't work in Access now because the SQL Server table uses a bigint PK and Access can't handle that.

    I'm trying to do this with a temporary table which does have an identity column. I created the following code.

    DECLARE @MyCounter int;

    SELECT @MyCounter=MAX(Trans_ID)
    FROM AR_Transactions

    CREATE TABLE dbo.AR_Trans_test ( Trans_ID smallint identity(@MyCounter,1), TestName char(20) )

    The create statement doesn't work with the variable.
    Last edited by sync; 05-04-09 at 15:33.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts