 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Taking locks without doing SELECT WITH UPDLOCK</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/sql-server/taking-locks-without-doing-select-with-updlock/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/sql-server/taking-locks-without-doing-select-with-updlock/</link>
	<description></description>
	<lastBuildDate>Tue, 07 May 2013 13:39:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: SQLSoldier</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/taking-locks-without-doing-select-with-updlock/#comment-1069</link>
		<dc:creator>SQLSoldier</dc:creator>
		<pubDate>Tue, 07 Jun 2011 22:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/taking-locks-without-doing-select-with-updlock/#comment-1069</guid>
		<description><![CDATA[This method will generate 0 I/O&#039;s and will take a table lock that gets held for the duration of transaction:

[CODE]Checkpoint;
DBCC DROPCLEANBUFFERS 
GO 
SET STATISTICS IO ON 
GO 
BEGIN TRAN 
    SELECT *
    FROM Sales.SalesOrderDetail WITH (tabLOCK, holdlock) 
    Where 1 = 2
    
    Select *
    from sys.dm_tran_locks
    Where request_session_id = @@SPID
    /*Business Logic*/ 
COMMIT 
GO [/CODE]]]></description>
		<content:encoded><![CDATA[<p>This method will generate 0 I/O&#8217;s and will take a table lock that gets held for the duration of transaction:</p>
<p>[CODE]Checkpoint;<br />
DBCC DROPCLEANBUFFERS<br />
GO<br />
SET STATISTICS IO ON<br />
GO<br />
BEGIN TRAN<br />
    SELECT *<br />
    FROM Sales.SalesOrderDetail WITH (tabLOCK, holdlock)<br />
    Where 1 = 2</p>
<p>    Select *<br />
    from sys.dm_tran_locks<br />
    Where request_session_id = @@SPID<br />
    /*Business Logic*/<br />
COMMIT<br />
GO [/CODE]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
