I need reserve a identity of row from table for document number in multi user application.
Please Help me.
I need reserve a identity of row from table for document number in multi
Share
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.
If you absolutely need to reserve a document number, before you have complete data for a document, consider creating a row with the minimal amount of data, then later on you can update the record with valid data.
You may need to add some sort of flags so that you are not using this invalid data for reporting or other purposes. This is very important if others are querying your table.
Another option would be to create a table with an identity field and just enough information to understand the origin of the document. You use this table only for creating the document id and just not use identity feature on your main table. Depending on how far down the development cycle you are this may require major re-design of your code/application.
There are multiple ways you could implement this, however the question is, do you really need to reserve the id, or are you going to the database and causing round trips for no specific reason?