Inserting into table with one column 1,2,3,4...

  • Hi,

    I have a temporary table into which I insert bulk data from a stored procedure output. It will be easy for me if the temptable can have a column with sequential numbers 1,2,3,4,. I could not figure out a way to do it. This is the stripped down sql what I have in the stored procedure.

    insert into temptable select name, email, date from usertable where condition = xyz.

    I tried auto increment column with seed 1, increment 1. But if I delete and insert again it does not start from 1. Is there any way to accompolish this? It will make the front-end code very simple.

    Thank you

  • Please do not cross post. We all keep track of all the new questions on all the discussion forums.

    My answer has already been posted there.

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=155717

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply