Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 table purchase and purchaseProduct
purchase has primary key auto increment identity column
is it possilbe to get next identity of identity column and lock it so nothing can get wrong to insert in purchaseProduct table
Posted

1 solution

No, that's not guaranteed. You can easily find the next identity value, but another command might go and use it before you can make any use of it. See the detailed explanation here in a similar thread[^].


--Amit
 
Share this answer
 
Comments
deva936 26-Aug-13 7:42am    
thats why i asked any way to lock it?
_Amy 26-Aug-13 7:45am    
No, there is not any proper way to lock it. :)

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