Click to See Complete Forum and Search --> : Trying to Insert a Value that is incrementing for each new record


pickolizac
01-16-2008, 09:27 AM
hello,

I have Insert Into statement that looks like the one below and what im trying to do is Insert the following values into the tblCustInfo, Now in the "SeqNum" im inserting @SeqNum and i have set @SeqNum to = 1000 so what i want to do is, lets say i insert two records into the table, i want one record to be SeqNum 1000, and then the second record 2000 which would increment by 1000 for each additional record.

Im using SQL 2005 and i have tried many things but i cannot get it to work at all. Any help would be appreciated.


INSERT INTO tblCustinfo (Name, Address, City, State, ZipCode, SerNum, Qty, SeqNum, DATERECD)
VALUES (@Name, @Address, @City, @State, @ZipCode, @SerNum, @Qty, @SeqNum, @DateRecd)