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 Administration (2000)
 lock on partition view

Author  Topic 

rubs_65
Posting Yak Master

144 Posts

Posted - 2006-01-31 : 11:38:21
Hi,

I am running the following statement to take lock on the partition view i.e. that is locking all the underlying tables of the view:
Select 1 from view_name with(tablockx) where 0=1

Is it possible to take lock on the view without running any DML statement?
lock view_name in exclusive mode

Thanks
--Harvinder

bakerjon
Posting Yak Master

145 Posts

Posted - 2006-02-01 : 15:45:07
Actually, no. There is not even a queued schema lock like on other objects. That's why it's a best practice to have users access a UDF instead, so if you have to swap out a view definition, you can just rename UDFs instead of kicking people off the system.

Jon
-Like a kidney stone, this too shall pass.

http://www.sqljunkies.com/weblog/outerjoin
Go to Top of Page
   

- Advertisement -