In SQL Server 2000 or above is there anyway to handle an auto generated primary key (identity) column when using a statement like the following?
Insert Into TableName Values(?, ?, ?)
My goal is to NOT use the column names at all.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default, if you have an identity column, you do not need to specify it in the VALUES section. If your table is:
Then you can do:
This will auto-generate the ID for you, and you don’t have to think about it at all. If you
SET IDENTITY_INSERT MyTbl ON, you can assign a value to the ID column.