<?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; Enable and Disable Index Non Clustered Indexes Using T-SQL</title>
	<atom:link href="http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nick Large</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-327827</link>
		<dc:creator><![CDATA[Nick Large]]></dc:creator>
		<pubDate>Thu, 09 Aug 2012 18:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-327827</guid>
		<description><![CDATA[Hi Pinal.

This is a great script, but is there a revised version that includes tablename so that only the non-clustered indexes on a specific table are disabled/rebuilt?

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal.</p>
<p>This is a great script, but is there a revised version that includes tablename so that only the non-clustered indexes on a specific table are disabled/rebuilt?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-140203</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 10 Jun 2011 08:46:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-140203</guid>
		<description><![CDATA[This selects what you need

select clnum, linenum ,status ,max(date) as date from table
group by clnum, linenum ,status]]></description>
		<content:encoded><![CDATA[<p>This selects what you need</p>
<p>select clnum, linenum ,status ,max(date) as date from table<br />
group by clnum, linenum ,status</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kiran</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-139543</link>
		<dc:creator><![CDATA[kiran]]></dc:creator>
		<pubDate>Wed, 08 Jun 2011 05:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-139543</guid>
		<description><![CDATA[Hi all

Please  solve my prob anybody it is urgent
here i am giving some data. i want to delete duplicate records from table
these are all duplicate records with clnum,linenum,status from this data i have to consider only latest &quot;date&quot; records and &quot;id&quot; column is also unique and i have to delete old dated records.

clnum     linenum        status                date                                     id
1	3	11	2011-02-24	9092
1	3	11	2011-03-22	16235
2	4	11	2011-03-22	16290
2	4	11	2011-02-24	11572
3	2	11	2011-03-22	16222
2	4	11	2011-02-24	11572


for ex from the above data i have to consider only

clnum     linenum        status                date                                     id
1	3	11	2011-03-22	16235
2	4	11	2011-03-22	16290
3	2	11	2011-03-22	16222


and i have to delete

clnum     linenum        status                date                                     id
1	3	11	2011-02-24	9092
2	4	11	2011-02-24	11572
2	4	11	2011-02-24	11572


Please help me it&#039;s urgent]]></description>
		<content:encoded><![CDATA[<p>Hi all</p>
<p>Please  solve my prob anybody it is urgent<br />
here i am giving some data. i want to delete duplicate records from table<br />
these are all duplicate records with clnum,linenum,status from this data i have to consider only latest &#8220;date&#8221; records and &#8220;id&#8221; column is also unique and i have to delete old dated records.</p>
<p>clnum     linenum        status                date                                     id<br />
1	3	11	2011-02-24	9092<br />
1	3	11	2011-03-22	16235<br />
2	4	11	2011-03-22	16290<br />
2	4	11	2011-02-24	11572<br />
3	2	11	2011-03-22	16222<br />
2	4	11	2011-02-24	11572</p>
<p>for ex from the above data i have to consider only</p>
<p>clnum     linenum        status                date                                     id<br />
1	3	11	2011-03-22	16235<br />
2	4	11	2011-03-22	16290<br />
3	2	11	2011-03-22	16222</p>
<p>and i have to delete</p>
<p>clnum     linenum        status                date                                     id<br />
1	3	11	2011-02-24	9092<br />
2	4	11	2011-02-24	11572<br />
2	4	11	2011-02-24	11572</p>
<p>Please help me it&#8217;s urgent</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-100041</link>
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 15 Nov 2010 15:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-100041</guid>
		<description><![CDATA[Hello,
great script. Just one question:

Inside script, why don&#039;t check the value on &quot;is_unique&quot; field in sys.indexes too?

...WHERE	I.[INDEX_ID] &gt; 1 
AND I.[TYPE] = 2 
AND I.[IS_PRIMARY_KEY]  1
AND I.[IS_UNIQUE_CONSTRAINT]  1
AND I.[INDEX_ID] = SI.INDID&#039;

Should be:
...WHERE	I.[INDEX_ID] &gt; 1 
AND I.[TYPE] = 2 
AND I.[IS_PRIMARY_KEY]  1
AND I.[IS_UNIQUE_CONSTRAINT]  1
AND I.[INDEX_ID] = SI.INDID&#039;
AND I.[IS_UNIQUE]  1


TIA
David]]></description>
		<content:encoded><![CDATA[<p>Hello,<br />
great script. Just one question:</p>
<p>Inside script, why don&#8217;t check the value on &#8220;is_unique&#8221; field in sys.indexes too?</p>
<p>&#8230;WHERE	I.[INDEX_ID] &gt; 1<br />
AND I.[TYPE] = 2<br />
AND I.[IS_PRIMARY_KEY]  1<br />
AND I.[IS_UNIQUE_CONSTRAINT]  1<br />
AND I.[INDEX_ID] = SI.INDID&#8217;</p>
<p>Should be:<br />
&#8230;WHERE	I.[INDEX_ID] &gt; 1<br />
AND I.[TYPE] = 2<br />
AND I.[IS_PRIMARY_KEY]  1<br />
AND I.[IS_UNIQUE_CONSTRAINT]  1<br />
AND I.[INDEX_ID] = SI.INDID&#8217;<br />
AND I.[IS_UNIQUE]  1</p>
<p>TIA<br />
David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amarjeet Singh</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-73624</link>
		<dc:creator><![CDATA[Amarjeet Singh]]></dc:creator>
		<pubDate>Fri, 28 May 2010 06:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-73624</guid>
		<description><![CDATA[Its Awesome.]]></description>
		<content:encoded><![CDATA[<p>Its Awesome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Disable Clustered Index and Data Insert Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-67658</link>
		<dc:creator><![CDATA[SQL SERVER – Disable Clustered Index and Data Insert Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Thu, 29 Apr 2010 03:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-67658</guid>
		<description><![CDATA[[...] SQL SERVER – Enable and Disable Index Non Clustered Indexes Using T-SQL [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Enable and Disable Index Non Clustered Indexes Using T-SQL [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-62294</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 10:40:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-62294</guid>
		<description><![CDATA[Hello Emeka,

Please make sure that you have required permission to see the result of sys.databases catalog view. According to BOL:

&quot;If the caller of sys.databases is not the owner of the database and the database is not master or tempdb, the minimum permissions required to see the corresponding row are ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission, or CREATE DATABASE permission in the master database.&quot;

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hello Emeka,</p>
<p>Please make sure that you have required permission to see the result of sys.databases catalog view. According to BOL:</p>
<p>&#8220;If the caller of sys.databases is not the owner of the database and the database is not master or tempdb, the minimum permissions required to see the corresponding row are ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission, or CREATE DATABASE permission in the master database.&#8221;</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EMEKA</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-62260</link>
		<dc:creator><![CDATA[EMEKA]]></dc:creator>
		<pubDate>Fri, 05 Mar 2010 17:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-62260</guid>
		<description><![CDATA[it&#039;s not working on my adventureworks database
when i try to use is says invalid object name sys.databases]]></description>
		<content:encoded><![CDATA[<p>it&#8217;s not working on my adventureworks database<br />
when i try to use is says invalid object name sys.databases</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prince</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-46989</link>
		<dc:creator><![CDATA[prince]]></dc:creator>
		<pubDate>Sat, 21 Feb 2009 03:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-46989</guid>
		<description><![CDATA[good]]></description>
		<content:encoded><![CDATA[<p>good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-46947</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Fri, 20 Feb 2009 04:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-46947</guid>
		<description><![CDATA[@Simon Worth

I appreciate your response for the above article. I am not a genius.  I love when experts like you comment on my work. I thank you for the same.

I will not defend myself, but would like to bring two points to your notice,

1. Script by default will not change recovery model, unless user specify an option to change it. It is just an added option.

2. This is only for Non-Clustered Index (excluding one created on Primary Keys and Unique Keys). Script was created to reduce execution time for huge data loads.

@Jason Crider

Thanks for comment, I completely agree with you. 

I could have added Fill Factor as a parameter when rebuilding indexes, I could have used case function and removed many IF statements.

Regards,
IM.]]></description>
		<content:encoded><![CDATA[<p>@Simon Worth</p>
<p>I appreciate your response for the above article. I am not a genius.  I love when experts like you comment on my work. I thank you for the same.</p>
<p>I will not defend myself, but would like to bring two points to your notice,</p>
<p>1. Script by default will not change recovery model, unless user specify an option to change it. It is just an added option.</p>
<p>2. This is only for Non-Clustered Index (excluding one created on Primary Keys and Unique Keys). Script was created to reduce execution time for huge data loads.</p>
<p>@Jason Crider</p>
<p>Thanks for comment, I completely agree with you. </p>
<p>I could have added Fill Factor as a parameter when rebuilding indexes, I could have used case function and removed many IF statements.</p>
<p>Regards,<br />
IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Crider</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-46942</link>
		<dc:creator><![CDATA[Jason Crider]]></dc:creator>
		<pubDate>Fri, 20 Feb 2009 02:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-46942</guid>
		<description><![CDATA[Good idea, but what about breaking the backup log chain.

http://msdn.microsoft.com/en-us/library/ms178052(SQL.90).aspx]]></description>
		<content:encoded><![CDATA[<p>Good idea, but what about breaking the backup log chain.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms178052(SQL.90)" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms178052(SQL.90)</a>.aspx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Worth</title>
		<link>http://blog.sqlauthority.com/2009/02/19/sql-server-enable-and-disable-index-non-clustered-indexes-using-t-sql/#comment-46941</link>
		<dc:creator><![CDATA[Simon Worth]]></dc:creator>
		<pubDate>Fri, 20 Feb 2009 02:11:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2710#comment-46941</guid>
		<description><![CDATA[What would be the ramifications of changing the recovery model of your database?
You would have a service level agreement with the business on a recovery strategy and changing your recovery model during maintenance tasks probably is not part of this agreement.  Plus, how do you recover if the database goes down after you have switched the recovery model back and forth from full or bulk logged to simple and then back again?  
Are you taking a full backup once the database is in simple mode - or what exactly would be your suggested approach of keeping integrity within the database and backups of the database in sync with what you are doing as well as keeping to the contract of your SLA?
I see this as a fun thing to do on a database that has no value such as adventureworks, but on a production database - processing many transactions per minute - with a service level agreement in place on a recovery strategy this is not going to sit well with the business that is paying for your services.]]></description>
		<content:encoded><![CDATA[<p>What would be the ramifications of changing the recovery model of your database?<br />
You would have a service level agreement with the business on a recovery strategy and changing your recovery model during maintenance tasks probably is not part of this agreement.  Plus, how do you recover if the database goes down after you have switched the recovery model back and forth from full or bulk logged to simple and then back again?<br />
Are you taking a full backup once the database is in simple mode &#8211; or what exactly would be your suggested approach of keeping integrity within the database and backups of the database in sync with what you are doing as well as keeping to the contract of your SLA?<br />
I see this as a fun thing to do on a database that has no value such as adventureworks, but on a production database &#8211; processing many transactions per minute &#8211; with a service level agreement in place on a recovery strategy this is not going to sit well with the business that is paying for your services.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
