I have a website adding orders to my database. These start at 10000000 and increment by 1.

I have pieces of paper sent out in advance with order numbers on them. These start at 50000000 and increment by 1.

We get batches of paper orders brought back and need to input them. The details ar't important but the point is that i need to do this...

website adds 10000123
website adds 10000124
website adds 10000125
save 10000125 as the last id

Lock the database so the website can't insert any orders.

DBCC CHECKIDENT sets to the ordernumber on the paper sheet (50001234)
insert the paper order 50001234

set the primary key back to 10000125
website adds 10000126
website adds 10000127

The problem is I don't know how to lock the database. And if the database is locked I'm not sure how the website will react.

I have no idea what to google.

Recommended Answers

I dont know how, but I just want to remind you to back-up

Jump to Post

All 2 Replies

I dont know how, but I just want to remind you to back-up

not a problem at the momment I only have 4 orders and they are mine. It's brand new.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.