<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx</link><description>Back when the lock manager was rewritten for SQL Server 7, and row level locking was added to the product, the procedure sp_indexoption gave us the ability to turn OFF either row or page locks or both, for one particular index, or for a table and all</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43257</link><pubDate>Tue, 08 May 2012 10:17:05 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43257</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hi Kalen,&lt;/p&gt;
&lt;p&gt;Interesting post, thank you. &amp;nbsp;From SQL 2008 onward, there's also:&lt;/p&gt;
&lt;p&gt;ALTER TABLE dbo.testlocks REBUILD&lt;/p&gt;
&lt;p&gt;WITH (ALLOW_ROW_LOCKS = OFF);&lt;/p&gt;
&lt;p&gt;I can't see many differences between this and using ALTER INDEX ALL (both affect the heap and any indexes) but this syntax is a bit richer, for example:&lt;/p&gt;
&lt;p&gt;ALTER TABLE dbo.testlocks REBUILD&lt;/p&gt;
&lt;p&gt;WITH (ALLOW_ROW_LOCKS = ON, ONLINE = ON, DATA_COMPRESSION = ROW);&lt;/p&gt;
&lt;p&gt;Kinda odd that there are two syntaxes for essentially the same thing, and no way (that I can see) to affect just the heap.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43262</link><pubDate>Tue, 08 May 2012 14:44:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43262</guid><dc:creator>Jungsun Kim</dc:creator><description>&lt;p&gt;Dear Kalen,&lt;/p&gt;
&lt;p&gt;&amp;quot;First create a heap with a clustered index:&amp;quot;&lt;/p&gt;
&lt;p&gt;--&amp;gt; &amp;quot;First create a heap with a Nonclustered index:&amp;quot;&lt;/p&gt;
&lt;p&gt;Am I right?&lt;/p&gt;
&lt;p&gt;Anyway, thank you for the good post.&lt;/p&gt;
&lt;p&gt;Reagrds,&lt;/p&gt;
&lt;p&gt;Jungsun&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43273</link><pubDate>Wed, 09 May 2012 01:15:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43273</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Thanks Paul! &amp;nbsp;In class, I talk about ALTER TABLE REBUILD for other purposes (like just simply rebuilding a heap), but completely overlooked that it could change the lock properties. I guess if we just want to affect the heap, we'll have to change everything,and then change the nc indexes back individually. I do like the idea of using the ALTER TABLE instead of the ALTER INDEX for this purpose.&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43274</link><pubDate>Wed, 09 May 2012 01:16:35 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43274</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Thanks Jungsun, for your careful reading and your correction! I have fixed the mistake.&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43275</link><pubDate>Wed, 09 May 2012 03:38:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43275</guid><dc:creator>Mbourgon</dc:creator><description>&lt;p&gt;Another reason you see locks turned off was because of a bug in SSMS 2005, (RTM,I think). We kept having to turn them back on until we figured out it was one particular developer using the older version of SSMS. &amp;nbsp;Thanks for the info; hopefully we won't need it. :)&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43342</link><pubDate>Mon, 14 May 2012 11:35:55 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43342</guid><dc:creator>Adithya</dc:creator><description>&lt;p&gt;I never knew this. However, as you said when Row and Page Level Locks are turned off or disallowed, is it not problematic when SQL Server takes up only the table locks.&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43347</link><pubDate>Mon, 14 May 2012 19:02:19 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43347</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Hi Adithya&lt;/p&gt;
&lt;p&gt;Yes, that was my last paragraph... I am not recommending you turn off row and/or page locks as it can cause more problems than it solves!&lt;/p&gt;
&lt;p&gt;~Kalen&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43358</link><pubDate>Tue, 15 May 2012 09:35:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43358</guid><dc:creator>Nimesh Parikh</dc:creator><description>&lt;p&gt;Mem,&lt;/p&gt;
&lt;p&gt;I have different question, but on Index only.&lt;/p&gt;
&lt;p&gt;I was using SP_SPACEUSED and it gave me some strange result. even though I do not have any index on table, result shows me that SQL Server has occupy some space.&lt;/p&gt;
&lt;p&gt;2 pages. why is that so..?&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#43388</link><pubDate>Wed, 16 May 2012 16:11:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43388</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Nimesh&lt;/p&gt;
&lt;p&gt;Comments on a blog post are not the best place to get help with totally unrelated questions. I usually just ignore them, and sometimes I remove them. But I was looking for a topic for my SQL Server Magazine newsletter article, so I decided to use this question as a basis. So the answer will appear to tomorrow in newsletter. &lt;/p&gt;
&lt;p&gt;You can subscribe to the SQL Server Pro UPDATE newsletter here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://forms.sqlmag.com/forms/Subscribe-Free-SQLServerMag-Newsletters"&gt;http://forms.sqlmag.com/forms/Subscribe-Free-SQLServerMag-Newsletters&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Kalen&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#44139</link><pubDate>Fri, 29 Jun 2012 05:21:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44139</guid><dc:creator>Paul Harrington</dc:creator><description>&lt;p&gt;Hi Kalen,&lt;/p&gt;
&lt;p&gt;Thanks for the timely article I think it is going to solve a deadlock problem I have. I am getting deadlocks as a result of pagelocks on an index. I have multiple processes processing data in the same table but there is a batch ID on the rows to keep the processing separate. Occasionally we are encountering deadlock on the index pages. &amp;nbsp;I am going to try removing page locking on the index to see if that fixes the problem.&lt;/p&gt;
&lt;p&gt;Paul.&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#47998</link><pubDate>Sat, 02 Mar 2013 06:10:14 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47998</guid><dc:creator>Mohnish</dc:creator><description>&lt;p&gt;Thank for the help....It worked&lt;/p&gt;
</description></item><item><title>re: Did You Know? Turning Off Locking</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2012/05/07/turning-off-locking.aspx#48057</link><pubDate>Tue, 05 Mar 2013 22:06:56 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48057</guid><dc:creator>Aneesh</dc:creator><description>&lt;p&gt;Kalen, &lt;/p&gt;
&lt;p&gt;Just curious, what kind of problems we can resolve thru allowing pagelocks and RowLocks at an index level.&lt;/p&gt;
</description></item></channel></rss>