Click here to Skip to main content
15,888,590 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My table fields(of SQL server-2008) are as follows.
//------------------------------------------------
item_id (This should be an int-AutoIncrement. How can I achive this)
Item_Name(primary-Key)
Item_Brand(primary-Key)
Item_ModelNo(primary-Key)
Posted
Updated 25-Oct-19 21:56pm

1 solution

Very easy :D
Set its Is Identity to Yes in Indentity Specification in Column Properties (if using SQL server Management studio)

or

if using query use below:

SQL
P_Id int NOT NULL AUTO_INCREMENT


See more info @ http://www.w3schools.com/sql/sql_autoincrement.asp[^]
 
Share this answer
 
v2
Comments
SHAJANCHERIAN 13-Apr-11 1:13am    
Thanks a lot..
Wild-Programmer 13-Apr-11 4:55am    
Thankx Shajancherian.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900