<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Difference Between Index Rebuild and Index Reorganize Explained with T-SQL Script</title>
	<atom:link href="http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: fbit_user</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-57497</link>
		<dc:creator>fbit_user</dc:creator>
		<pubDate>Tue, 10 Nov 2009 15:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-57497</guid>
		<description>is this rebuilding or reorganising indexes affect sizes of differential backups?? because i read some where if database if too huge (like 7gb)  and if we donot consider rebuilding/reorganising indexes into consideration while taking diff bkps, resultant diff bkps are huge in size?? is that correct?</description>
		<content:encoded><![CDATA[<p>is this rebuilding or reorganising indexes affect sizes of differential backups?? because i read some where if database if too huge (like 7gb)  and if we donot consider rebuilding/reorganising indexes into consideration while taking diff bkps, resultant diff bkps are huge in size?? is that correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kuldeep Sirohi</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-56455</link>
		<dc:creator>kuldeep Sirohi</dc:creator>
		<pubDate>Tue, 06 Oct 2009 04:14:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-56455</guid>
		<description>Hi Penal

i am getting the following error at one of my sql server databases

&quot;[298] SQLServer Error: 1204, The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. [SQLSTATE HY000]&quot;

while finding out the solutions on internet I found that by changing the locks configuration through sp_configure locks this problem can be resolved. but in one of the MS notes it is said that it should be set to 0. and I found it is already set to 0. what should I do in this case</description>
		<content:encoded><![CDATA[<p>Hi Penal</p>
<p>i am getting the following error at one of my sql server databases</p>
<p>&#8220;[298] SQLServer Error: 1204, The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. [SQLSTATE HY000]&#8221;</p>
<p>while finding out the solutions on internet I found that by changing the locks configuration through sp_configure locks this problem can be resolved. but in one of the MS notes it is said that it should be set to 0. and I found it is already set to 0. what should I do in this case</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jane</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-56057</link>
		<dc:creator>Jane</dc:creator>
		<pubDate>Tue, 22 Sep 2009 09:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-56057</guid>
		<description>@joshua

Any joy?  It failed again this week.  That said, it succeeded once after I&#039;d rebuilt the index...

It&#039;s a reorganize index that&#039;s failing, which shouldn&#039;t be affected by users being logged in.

Thanks</description>
		<content:encoded><![CDATA[<p>@joshua</p>
<p>Any joy?  It failed again this week.  That said, it succeeded once after I&#8217;d rebuilt the index&#8230;</p>
<p>It&#8217;s a reorganize index that&#8217;s failing, which shouldn&#8217;t be affected by users being logged in.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55871</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Tue, 15 Sep 2009 01:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55871</guid>
		<description>@jane

good day, if i am not mistaken this kind of error usually happens when the table is locked or being used by certain user or users... i&#039;ll try to disconnect all the users tonight and test the rebuild index without any users accessing the database... if it works i&#039;ll post the result here as soon as possible... 

to: Pinal, Imran Mohammed, Sandy,
please correct me if i am wrong... 

thanks...</description>
		<content:encoded><![CDATA[<p>@jane</p>
<p>good day, if i am not mistaken this kind of error usually happens when the table is locked or being used by certain user or users&#8230; i&#8217;ll try to disconnect all the users tonight and test the rebuild index without any users accessing the database&#8230; if it works i&#8217;ll post the result here as soon as possible&#8230; </p>
<p>to: Pinal, Imran Mohammed, Sandy,<br />
please correct me if i am wrong&#8230; </p>
<p>thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jane</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55858</link>
		<dc:creator>Jane</dc:creator>
		<pubDate>Mon, 14 Sep 2009 09:55:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55858</guid>
		<description>I&#039;ve got a new variation on this particular error (on SQL2008)

Executing the query &quot;ALTER INDEX [PageUrlID_FK] ON [dbo].[WebParts] REO...&quot; failed with the following error: &quot;A severe error occurred on the current command.  The results, if any, should be discarded.&quot;. Possible failure reasons: Problems with the query, &quot;ResultSet&quot; property not set correctly, parameters not set correctly, or connection not established correctly.

It&#039;s a SharepointDB, and this is about 1/3 way down the T-SQL that the job generates automatically.

ALLOW_PAGE_LOCKS is on.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got a new variation on this particular error (on SQL2008)</p>
<p>Executing the query &#8220;ALTER INDEX [PageUrlID_FK] ON [dbo].[WebParts] REO&#8230;&#8221; failed with the following error: &#8220;A severe error occurred on the current command.  The results, if any, should be discarded.&#8221;. Possible failure reasons: Problems with the query, &#8220;ResultSet&#8221; property not set correctly, parameters not set correctly, or connection not established correctly.</p>
<p>It&#8217;s a SharepointDB, and this is about 1/3 way down the T-SQL that the job generates automatically.</p>
<p>ALLOW_PAGE_LOCKS is on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55768</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Thu, 10 Sep 2009 10:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-55768</guid>
		<description>Need help with regards to this REBUILD ISSUE AGAIN...
@Imran Mohammed
@Sandy

Executing the query &quot;ALTER INDEX [KBA_CCLSDPA_PR] ON [dbo].[@BA_CCLSDPA] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = ON )
&quot; failed with the following error: &quot;Online index operation cannot be performed for index &#039;KBA_CCLSDPA_PR&#039; because the index contains column &#039;U_DprTypID&#039; of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.&quot;. Possible failure reasons: Problems with the query, &quot;ResultSet&quot; property not set correctly, parameters not set correctly, or connection not established correctly.

Note:

I tried to do the maintenance in our:
TEST SERVER - NO ERROR FOUND
PRODUCTION SERVER - and i found the error above

TEST SERVER - NO ONE IS CONNECTED ON IT
PRODUCTION SERVER - there are 3-5 users connected but less transaction because i did it at night...

hope you can help me with this problem... 

i been experiencing this problem since i started posting here... 

my last option is: TO DISCONNECT ALL USERS AND RUN THE REBUILD_INDEX for 3 hours... 

SHRINK_DATABASE ISSUE HAS BEEN RESOLVED... 

thanks...</description>
		<content:encoded><![CDATA[<p>Need help with regards to this REBUILD ISSUE AGAIN&#8230;<br />
@Imran Mohammed<br />
@Sandy</p>
<p>Executing the query &#8220;ALTER INDEX [KBA_CCLSDPA_PR] ON [dbo].[@BA_CCLSDPA] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = ON )<br />
&#8221; failed with the following error: &#8220;Online index operation cannot be performed for index &#8216;KBA_CCLSDPA_PR&#8217; because the index contains column &#8216;U_DprTypID&#8217; of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.&#8221;. Possible failure reasons: Problems with the query, &#8220;ResultSet&#8221; property not set correctly, parameters not set correctly, or connection not established correctly.</p>
<p>Note:</p>
<p>I tried to do the maintenance in our:<br />
TEST SERVER &#8211; NO ERROR FOUND<br />
PRODUCTION SERVER &#8211; and i found the error above</p>
<p>TEST SERVER &#8211; NO ONE IS CONNECTED ON IT<br />
PRODUCTION SERVER &#8211; there are 3-5 users connected but less transaction because i did it at night&#8230;</p>
<p>hope you can help me with this problem&#8230; </p>
<p>i been experiencing this problem since i started posting here&#8230; </p>
<p>my last option is: TO DISCONNECT ALL USERS AND RUN THE REBUILD_INDEX for 3 hours&#8230; </p>
<p>SHRINK_DATABASE ISSUE HAS BEEN RESOLVED&#8230; </p>
<p>thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Herb</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53422</link>
		<dc:creator>Herb</dc:creator>
		<pubDate>Thu, 02 Jul 2009 13:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53422</guid>
		<description>Hello,

My question is as follows:  I have created a script to list all indexes with a fragmentation percent greater than 10.  Next, this script will rebuild or reorganize these indexes based upon the fragmentation percent.  However, the same indexes keep showing up in this report.  So, I tried to manually rebuild with the same results, the framentation percent remain the same.  These indexes are not clustered indexes.  Would you be able to explain why this may be happening?

Herb</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>My question is as follows:  I have created a script to list all indexes with a fragmentation percent greater than 10.  Next, this script will rebuild or reorganize these indexes based upon the fragmentation percent.  However, the same indexes keep showing up in this report.  So, I tried to manually rebuild with the same results, the framentation percent remain the same.  These indexes are not clustered indexes.  Would you be able to explain why this may be happening?</p>
<p>Herb</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53384</link>
		<dc:creator>jack</dc:creator>
		<pubDate>Wed, 01 Jul 2009 19:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53384</guid>
		<description>I clearly read the dis-advantages of REBUILD - and MS says Reorganize if between 5-40% and rebuild if higher.

1. What are the disadvantage(s)  of REORGANIZE
2. Why wouldn&#039;t you REORGANIZE if the fragmentation was over 50%  (I assume the answer is poor use of resources, but I don&#039;t see that written anywhere)
3. Wouldn&#039;t a REORGANIZE of a Clustered Index also take a table lock?


Other index question - we have a (PK) Clustered Index on  table that is 24x7 - we start from scratch (empty) every quarter - and by week 4 the fragmentation is over 80% (yes, i know its a poorly designed PK and Clustered Key - its a vendor product).  The kicker is they don&#039;t want me take the app offline for a short maint window - is there any way to define the index with 4 leaf levels - since thats how many it will grow to?</description>
		<content:encoded><![CDATA[<p>I clearly read the dis-advantages of REBUILD &#8211; and MS says Reorganize if between 5-40% and rebuild if higher.</p>
<p>1. What are the disadvantage(s)  of REORGANIZE<br />
2. Why wouldn&#8217;t you REORGANIZE if the fragmentation was over 50%  (I assume the answer is poor use of resources, but I don&#8217;t see that written anywhere)<br />
3. Wouldn&#8217;t a REORGANIZE of a Clustered Index also take a table lock?</p>
<p>Other index question &#8211; we have a (PK) Clustered Index on  table that is 24&#215;7 &#8211; we start from scratch (empty) every quarter &#8211; and by week 4 the fragmentation is over 80% (yes, i know its a poorly designed PK and Clustered Key &#8211; its a vendor product).  The kicker is they don&#8217;t want me take the app offline for a short maint window &#8211; is there any way to define the index with 4 leaf levels &#8211; since thats how many it will grow to?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53363</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Wed, 01 Jul 2009 03:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-53363</guid>
		<description>@Imran Mohammed
@Sandy

Thanks for your responses, i did everything you said but unfortunately, it didn&#039;t, do u think there is an issue with MS SQL Server 2005? do i need to upgrade to SP3 since i am only using SP2?

thanks...</description>
		<content:encoded><![CDATA[<p>@Imran Mohammed<br />
@Sandy</p>
<p>Thanks for your responses, i did everything you said but unfortunately, it didn&#8217;t, do u think there is an issue with MS SQL Server 2005? do i need to upgrade to SP3 since i am only using SP2?</p>
<p>thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandy</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-52122</link>
		<dc:creator>Sandy</dc:creator>
		<pubDate>Wed, 20 May 2009 18:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-52122</guid>
		<description>@Joshua

As per BOL,while rebuilding index ,option 

ONLINE=ON will fai if there is  XML index or index consist of Large object data type columns inclyding image, text, ntext, varchar(max), nvarchar(max), varbinary(max), and xml.

Check your indexes to figure out if you really need ONLINE=ON option</description>
		<content:encoded><![CDATA[<p>@Joshua</p>
<p>As per BOL,while rebuilding index ,option </p>
<p>ONLINE=ON will fai if there is  XML index or index consist of Large object data type columns inclyding image, text, ntext, varchar(max), nvarchar(max), varbinary(max), and xml.</p>
<p>Check your indexes to figure out if you really need ONLINE=ON option</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51548</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Tue, 05 May 2009 05:33:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51548</guid>
		<description>@ Imran Mohammed

sir thanks for your reply actually here&#039;s what i did, 
i had the maintenance last May 2 @7PM up to May 3 @midnight, the error occured at around 5PM on May 3, i had 5 Maintenance, 

Check Database Integrity   Done          8sec
Shrink Database                  Error          27sec
Reorganize Index                Done          15:14:27   
Rebuild Index                      Error           0sec
Update Statistics                 Done          6:23:46

&quot;Long Story short, you cannot rebuild Clustered indexes when users are connected to database and accessing that particular table/ object. &quot; 
&quot;Try rebuilding indexes when no or very less users are accessing database. If not, rebuild indexes in maintenance window.&quot;
- NO USERS CONNECTED DURING THE MAINTENANCE. all users are locked and cannot access the database. 

&quot;If you have SQL Server 2005 Enterprise Edition, then you can rebuild index on a table when user is accessing that object, all you have to do is, set ONLINE = ON ( in your rebuild command, right now it is ONLINE = is set to OFF). This would increase Rebuild Index time significantly ( Which is not good). Make sure you test this in Dev/ Test Environment before implementing this in PROD.&quot; 
- I ALSO SET ONLINE = ON, but with different error message, and still was not able to rebuild the index. 

here are the actual errors for SHRINK DATABASE AND REBUILD INDEX:

REBUILD INDEX ERROR
ERROR NUMBER: -1073548784
ERROR MESSAGE:
Executing the query &quot;ALTER INDEX [KBA_CCLSDPA_PR] ON [dbo].[@BA_CCLSDPA] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = ON ) &quot; failed with the following error: &quot;Online index operation cannot be performed for index &#039;KBA_CCLSDPA_PR&#039; because the index contains column &#039;U_DprTypID&#039; of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.&quot;. Possible failure reasons: Problems with the query, &quot;ResultSet&quot; property not set correctly, parameters not set correctly, or connection not established correctly.

SHRINK DATABASE ERROR
ERROR NUMBER: -1073548784
ERROR MESSAGE: 
Executing the query &quot;DBCC SHRINKDATABASE(N&#039;ALC&#039;, 10, TRUNCATEONLY) &quot; failed with the following error: &quot;A severe error occurred on the current command.  The results, if any, should be discarded.&quot;. Possible failure reasons: Problems with the query, &quot;ResultSet&quot; property not set correctly, parameters not set correctly, or connection not established correctly.

i appreciate the solution sir, but i already did it but still it didn&#039;t work. 

thank you so much again...</description>
		<content:encoded><![CDATA[<p>@ Imran Mohammed</p>
<p>sir thanks for your reply actually here&#8217;s what i did,<br />
i had the maintenance last May 2 @7PM up to May 3 @midnight, the error occured at around 5PM on May 3, i had 5 Maintenance, </p>
<p>Check Database Integrity   Done          8sec<br />
Shrink Database                  Error          27sec<br />
Reorganize Index                Done          15:14:27<br />
Rebuild Index                      Error           0sec<br />
Update Statistics                 Done          6:23:46</p>
<p>&#8220;Long Story short, you cannot rebuild Clustered indexes when users are connected to database and accessing that particular table/ object. &#8221;<br />
&#8220;Try rebuilding indexes when no or very less users are accessing database. If not, rebuild indexes in maintenance window.&#8221;<br />
- NO USERS CONNECTED DURING THE MAINTENANCE. all users are locked and cannot access the database. </p>
<p>&#8220;If you have SQL Server 2005 Enterprise Edition, then you can rebuild index on a table when user is accessing that object, all you have to do is, set ONLINE = ON ( in your rebuild command, right now it is ONLINE = is set to OFF). This would increase Rebuild Index time significantly ( Which is not good). Make sure you test this in Dev/ Test Environment before implementing this in PROD.&#8221;<br />
- I ALSO SET ONLINE = ON, but with different error message, and still was not able to rebuild the index. </p>
<p>here are the actual errors for SHRINK DATABASE AND REBUILD INDEX:</p>
<p>REBUILD INDEX ERROR<br />
ERROR NUMBER: -1073548784<br />
ERROR MESSAGE:<br />
Executing the query &#8220;ALTER INDEX [KBA_CCLSDPA_PR] ON [dbo].[@BA_CCLSDPA] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = ON ) &#8221; failed with the following error: &#8220;Online index operation cannot be performed for index &#8216;KBA_CCLSDPA_PR&#8217; because the index contains column &#8216;U_DprTypID&#8217; of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.&#8221;. Possible failure reasons: Problems with the query, &#8220;ResultSet&#8221; property not set correctly, parameters not set correctly, or connection not established correctly.</p>
<p>SHRINK DATABASE ERROR<br />
ERROR NUMBER: -1073548784<br />
ERROR MESSAGE:<br />
Executing the query &#8220;DBCC SHRINKDATABASE(N&#8217;ALC&#8217;, 10, TRUNCATEONLY) &#8221; failed with the following error: &#8220;A severe error occurred on the current command.  The results, if any, should be discarded.&#8221;. Possible failure reasons: Problems with the query, &#8220;ResultSet&#8221; property not set correctly, parameters not set correctly, or connection not established correctly.</p>
<p>i appreciate the solution sir, but i already did it but still it didn&#8217;t work. </p>
<p>thank you so much again&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51505</link>
		<dc:creator>Imran Mohammed</dc:creator>
		<pubDate>Mon, 04 May 2009 05:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51505</guid>
		<description>@Joshua

I strongly suggest, you take a look at BOL about Indexes. 

A clustered index (leaf level page) contains real data of that object. 

In simple words, when you Rebuild Clustered Index it will put a lock on the table, because Index has to be rebuild meaning data was stored in one fashion earlier but by issuing Rebuild Index (for Clustered Index) command, you are asking SQL Server to again rebuild whole index i.e. store data in another fashion that is easily accessible . When data is being organized in another fashion, no user can access that object (Tables) until rebuild index process completes.

Long Story short, you cannot rebuild Clustered indexes when users are connected to database and accessing that particular table/ object. 

Error message you posted is self explanatory, explanation is, Rebuild Index command is trying to put a lock on that table, but that table is being used, that is why sql server is not able to put a lock on that table. Until SQL Server dont put a lock on that table, it cannot actually rebuild clustered Index.

For Non-Clustered Index, there is no such restriction. You can rebuild Non-Clustered Indexes when users are connected to the database. Reason behind this is, Clustered Index ( Leaf level Pages) do not real data, but contains pointer to Clustered Index.

Solution: 
1. Either Reorganize index instead of Rebuilding Index.
2. If you have SQL Server 2005 Enterprise Edition, then you can rebuild index on a table when user is accessing that object, all you have to do is, set ONLINE = ON ( in your rebuild command, right now it is ONLINE = is set to OFF). This would increase Rebuild Index time significantly ( Which is not good). Make sure you test this in Dev/ Test Environment before implementing this in PROD.
3. Try rebuilding indexes when no or very less users are accessing database. If not, rebuild indexes in maintenance window.

~ IM.</description>
		<content:encoded><![CDATA[<p>@Joshua</p>
<p>I strongly suggest, you take a look at BOL about Indexes. </p>
<p>A clustered index (leaf level page) contains real data of that object. </p>
<p>In simple words, when you Rebuild Clustered Index it will put a lock on the table, because Index has to be rebuild meaning data was stored in one fashion earlier but by issuing Rebuild Index (for Clustered Index) command, you are asking SQL Server to again rebuild whole index i.e. store data in another fashion that is easily accessible . When data is being organized in another fashion, no user can access that object (Tables) until rebuild index process completes.</p>
<p>Long Story short, you cannot rebuild Clustered indexes when users are connected to database and accessing that particular table/ object. </p>
<p>Error message you posted is self explanatory, explanation is, Rebuild Index command is trying to put a lock on that table, but that table is being used, that is why sql server is not able to put a lock on that table. Until SQL Server dont put a lock on that table, it cannot actually rebuild clustered Index.</p>
<p>For Non-Clustered Index, there is no such restriction. You can rebuild Non-Clustered Indexes when users are connected to the database. Reason behind this is, Clustered Index ( Leaf level Pages) do not real data, but contains pointer to Clustered Index.</p>
<p>Solution:<br />
1. Either Reorganize index instead of Rebuilding Index.<br />
2. If you have SQL Server 2005 Enterprise Edition, then you can rebuild index on a table when user is accessing that object, all you have to do is, set ONLINE = ON ( in your rebuild command, right now it is ONLINE = is set to OFF). This would increase Rebuild Index time significantly ( Which is not good). Make sure you test this in Dev/ Test Environment before implementing this in PROD.<br />
3. Try rebuilding indexes when no or very less users are accessing database. If not, rebuild indexes in maintenance window.</p>
<p>~ IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51495</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Sun, 03 May 2009 15:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51495</guid>
		<description>when i was rebuilding my database i had this error number -1073548784.. 
Executing the query &quot;ALTER INDEX [KBA_ODPV_PR] ON [dbo].[@BA_ODPV] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
&quot; failed with the following error: &quot;The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.
The statement has been terminated.&quot;. Possible failure reasons: Problems with the query, &quot;ResultSet&quot; property not set correctly, parameters not set correctly, or connection not established correctly.</description>
		<content:encoded><![CDATA[<p>when i was rebuilding my database i had this error number -1073548784..<br />
Executing the query &#8220;ALTER INDEX [KBA_ODPV_PR] ON [dbo].[@BA_ODPV] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )<br />
&#8221; failed with the following error: &#8220;The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.<br />
The statement has been terminated.&#8221;. Possible failure reasons: Problems with the query, &#8220;ResultSet&#8221; property not set correctly, parameters not set correctly, or connection not established correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51494</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Sun, 03 May 2009 15:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-51494</guid>
		<description>how will i know the percentage of my fragmented database?</description>
		<content:encoded><![CDATA[<p>how will i know the percentage of my fragmented database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jose</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-46607</link>
		<dc:creator>Jose</dc:creator>
		<pubDate>Thu, 12 Feb 2009 21:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-46607</guid>
		<description>HI, i have a index with 93% fragmented, then rebuild it, and now this same index has 73%,  why ? 
What can i do to have percentage more low? 
Drop and Create?
When rebuild were made with ONLINE=ON, affect that?

Thanks for your help!!!</description>
		<content:encoded><![CDATA[<p>HI, i have a index with 93% fragmented, then rebuild it, and now this same index has 73%,  why ?<br />
What can i do to have percentage more low?<br />
Drop and Create?<br />
When rebuild were made with ONLINE=ON, affect that?</p>
<p>Thanks for your help!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennies</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-46119</link>
		<dc:creator>Dennies</dc:creator>
		<pubDate>Thu, 29 Jan 2009 04:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-46119</guid>
		<description>Hi Dave, 

Thank you very much! this site is a very big help keep it up (^^,)</description>
		<content:encoded><![CDATA[<p>Hi Dave, </p>
<p>Thank you very much! this site is a very big help keep it up (^^,)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Simoes</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-45946</link>
		<dc:creator>Luis Simoes</dc:creator>
		<pubDate>Fri, 23 Jan 2009 17:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-45946</guid>
		<description>Rebuilding Partitioned Index with ONLINE = ON is this possible? How?

Regards</description>
		<content:encoded><![CDATA[<p>Rebuilding Partitioned Index with ONLINE = ON is this possible? How?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajith</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-44249</link>
		<dc:creator>Ajith</dc:creator>
		<pubDate>Mon, 17 Nov 2008 12:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-44249</guid>
		<description>HI dhaka,

please post the error message that was displayed in the particular step which failed. only that will give a clear picture.</description>
		<content:encoded><![CDATA[<p>HI dhaka,</p>
<p>please post the error message that was displayed in the particular step which failed. only that will give a clear picture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhaka</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-41886</link>
		<dc:creator>Dhaka</dc:creator>
		<pubDate>Thu, 21 Aug 2008 21:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-41886</guid>
		<description>Any one know whay above  jobs failed</description>
		<content:encoded><![CDATA[<p>Any one know whay above  jobs failed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhaka</title>
		<link>http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-41885</link>
		<dc:creator>Dhaka</dc:creator>
		<pubDate>Thu, 21 Aug 2008 21:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/22/sql-server-difference-between-index-rebuild-and-index-reorganize-explained-with-t-sql-script/#comment-41885</guid>
		<description>Job Name		Reorganize Index task MaintenancePlan for User DB
Step Name		Subplan_1
Duration		00:00:15
Sql Severity		0
Sql Message ID		0
Operator Emailed		
Operator Net sent		
Operator Paged		
Retries Attempted		0

Message
Executed as user: MICROSOFT\SQLAdmin. ...n 9.00.3042.00 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:25:38 PM  Progress: 2008-08-21 16:25:47.04     Source: {F2EF9F9E-923D-4BE6-B6A1-376E9171553A}      Executing query &quot;DECLARE @Guid UNIQUEIDENTIFIER      EXECUTE msdb..sp&quot;.: 100% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &quot;USE [xxxx]  &quot;.: 5% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &quot;ALTER INDEX [PK__ENUM_LIST_DEF__07F6335A] ON [dbo]&quot;.: 11% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &quot;USE [xxxx]  &quot;.: 16% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &quot;ALTER INDEX [PK__ENUM_LIST_ENTRY__0BC6C43E] ON [db&quot;.: 22% complete  End Progress  Progress...  The package execution fa...  The step failed.</description>
		<content:encoded><![CDATA[<p>Job Name		Reorganize Index task MaintenancePlan for User DB<br />
Step Name		Subplan_1<br />
Duration		00:00:15<br />
Sql Severity		0<br />
Sql Message ID		0<br />
Operator Emailed<br />
Operator Net sent<br />
Operator Paged<br />
Retries Attempted		0</p>
<p>Message<br />
Executed as user: MICROSOFT\SQLAdmin. &#8230;n 9.00.3042.00 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:25:38 PM  Progress: 2008-08-21 16:25:47.04     Source: {F2EF9F9E-923D-4BE6-B6A1-376E9171553A}      Executing query &#8220;DECLARE @Guid UNIQUEIDENTIFIER      EXECUTE msdb..sp&#8221;.: 100% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &#8220;USE [xxxx]  &#8220;.: 5% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &#8220;ALTER INDEX [PK__ENUM_LIST_DEF__07F6335A] ON [dbo]&#8220;.: 11% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &#8220;USE [xxxx]  &#8220;.: 16% complete  End Progress  Progress: 2008-08-21 16:25:51.05     Source: Reorganize Index Task 1      Executing query &#8220;ALTER INDEX [PK__ENUM_LIST_ENTRY__0BC6C43E] ON [db&#8221;.: 22% complete  End Progress  Progress&#8230;  The package execution fa&#8230;  The step failed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
