February 27, 2008 at 5:10 pm
Hi All,
Is there a way I can read the SQL contents of a view into a variable using ADO? I want to do this because my client has updateable views and we need to add a NOLOCK directive. It is my understanding, if the view contains NOLOCKs then the tables will not get locked when doing an insert/update regardless of the ADO lock type. But in normal circumstances they need the NOLOCK to avoid bottlenecks.
Thanks in advance...
February 28, 2008 at 11:19 am
from the docs:
NOLOCK
Does not issue any locks. This is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.
Note:
With SQL Server, a NOLOCK hint enables Read Uncommitted behavior. With SQL Server Compact Edition, using a NOLOCK hint still gives a Read Committed isolation level. SQL Server Compact Edition maintains copies of data to ensure that data can be read without needing share locks to help protect the data.
You'll be able to override the lock and declare your intentions when you select data for editting by using HOLDLOCK when reading from the view.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply