Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
AutoIncrement Primary Key like prodid fir insert the data into database..
Posted

Set IDENTITY_INSERT on first & then set it increment by 1.

http://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx[^]
 
Share this answer
 
v2
Comments
mohit jain 24-Sep-12 6:46am    
thks..
work it..
Prasad_Kulkarni 24-Sep-12 8:28am    
You're welcome,
Glad it helps!
hi u can set it at a time of table creation.

in sqlserver -> table desing->clumn properties->Identity specification->Identity increment make it 1.

this will solve ur issue.....
 
Share this answer
 
Comments
mohit jain 24-Sep-12 4:21am    
no another reply...
If i set identity increment by 1
the press save button for insert then it say Identify set OFF...
fjdiewornncalwe 25-Sep-12 14:47pm    
Please don't use textspeak in your responses. Use full words. Cheers.
u should try this :
create table table1(ProductId int IDENTITY)

Hope this will help u .
 
Share this answer
 

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