Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deadlocks in SQL Server
Message
 
To
07/07/2009 10:44:09
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01410522
Message ID:
01410568
Views:
40
>I've noticed that even a select statement on one table is locking it. ie select prodcode from tuserprod somehow locks tuserprod table.

SQL Server uses read and write locks. By default you cannot update data that another process tries to read. SQL server achieves this by placing a read lock on data it SELECTs. See here for more information: http://msdn.microsoft.com/en-us/library/ms189122.aspx

>Funny thing is that even after I close the form in question, the lock still exists, how do I unlock this?

The lock exists as long as the transaction on the connection has uncommitted changed. If you use manual transactions and SPT, this means until you issue either SQLCOMMIT() or SQLROLLBACK(). With automatic transactions (the default), the lock is released after each statement completes.
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform