Say I have a table that looks like:
ID Name Age Co 1 Adls 15 US 2 sldkl 14 FR 3 sldke 16 UK 4 sldee 17 IN I want to add values to the table and have the ID incremented. ID is the primary key, and I set is Identity under column properties to 'Yes' and identity increment to 1.
So basically, I am doing:
Insert Into TableName(Name, Age, Co) Values(slkdje, 19, CH) (sldjklse, 20, AU) (slfjke, 12, PK) But, I am getting errors that the primary key is null, and therefore this operation in invalid. How would I add the values, but get the primary key values to increment?
AUTO_INCREMENTyou can set on a column, see: Auto Increment.SHOW CREATE TABLE TableNamegive? Please add to your question...