Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Locking

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-11 : 11:25:34
Mariam writes "Hi team,
how can i lock SQL DB during running transaction.
i am working in HMS system, and i face a problem when 2 guests or more want to make a reservation simulatanusly.
even if one for read and other for write
how can i lock the tables or records if possible till the transaction is finished???
and can i assign priority for transaction
thanks alot"

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-11 : 11:32:36
Create a table which you lock.
Then in your stored procs you can gain a lock on the table when you want to synchronise processes. You can allow reads just by not taking the lock.
You can put an identifier in the table an allocate your spid and login time to it to lock an individual row.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -