Author |
Topic |
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 12:33:18
|
I am using SQL 2005 Express.....I would like to know if I can Lock a Table, Database or Record via the login I have in my .Net connection string code? Nothing would be performed physically from within SQL Server Management program. It would have to be done as part of my connection string and login object.In my old database (Access 2000) you could not exclusively lock a TABLE, only the Entire Database.I am looking to understand the Exclusive concepts in SQL 2005. Any help would be greatly appreciated.Thank you. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 13:14:44
|
So just so that I understand correctly. I would have something part of my SQL statement stating the exclusive locking?i.e. SELECT * FROM MYTABLENAME WHERE X=0I am know SQL statements....but I dont know how to integrate your comment into an SQL statement. Could you give a simple example of exclusive locking a table, an entire database, and a individual record? or know of a website that has that example. I did a google search for that and couldnt find much. |
|
|
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 13:18:31
|
In Access/VB6 it was part of your Connection string and Login object, not the actual Query statement. Trying to shift my mentality. |
|
|
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 13:20:32
|
Ideally, Id like to be able to Exclusively lock a Table....Records and Database locking would be a bonus if SQL2005 can even do that too. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 13:56:35
|
@tkizer Could you confirm that this link is what your talking about when referring to Locking within the Query?http://blog.sqlauthority.com/2007/04/27/sql-server-2005-locking-hints-and-examples/ |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dragonsbb1616
Starting Member
6 Posts |
Posted - 2011-05-25 : 15:59:47
|
Thank you for all help in narrowing my search. That was spot on. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|