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 the value of column

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2006-12-04 : 07:15:40
how to lock a particular column in a database
unit idno token name
30 rab1 a032 test
30 rab2 a033 kkk
31 rab3 b031 mmm

statatement:i want to lock the unit 30 while iam accessing the records from other seeing.after seeing the unit(30) i want to release the lock.how to do this

nr
SQLTeam MVY

12543 Posts

Posted - 2006-12-04 : 07:17:43
I would do this by haveing another table - add the entry to that table to indicate the row is locked.
All SPs that access the table use that locking table to see if the row is locked.

You can also do it with a flag on the table.
You will need to hold something to check that the connection hasn't been lost - I usually use the spid and logon time.

==========================================
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 -