<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>techencoder &#187; SQL Server</title>
	<atom:link href="http://techencoder.com/index.php/tag/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://techencoder.com</link>
	<description>Technical ideas in a human readable format</description>
	<lastBuildDate>Tue, 31 Aug 2010 02:15:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>		<item>
		<title>T-SQL: Cannot drop the index because it does not exist or you do not have permission.</title>
		<link>http://techencoder.com/index.php/2010/02/tsql-cannot-drop-theindex/</link>
		<comments>http://techencoder.com/index.php/2010/02/tsql-cannot-drop-theindex/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 12:20:43 +0000</pubDate>
		<dc:creator>r.claypool</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://techencoder.com/?p=1085</guid>
		<description><![CDATA[Quick tip:&#160;&#160; The table name and index name are required to drop an index, otherwise SQL Server will return an error. e.g. DROP INDEX &#91;dbo&#93;.&#91;IX_MyIndex&#93; fails with &#8230; Msg 3701, Level 11, State 6, Line XX Cannot drop the index 'dbo.IX_MyIndex', because it does not exist or you do not have permission. However, DROP INDEX [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://techencoder.com/wp-content/uploads/2010/02/database.jpg"><img src="http://techencoder.com/wp-content/uploads/2010/02/database.jpg" alt="database" title="database" width="600" height="153" class="aligncenter size-full wp-image-1123" /></a></p>
<p><strong>Quick tip:</strong>&nbsp;&nbsp; The table name <em>and</em> index name are required to drop an index, otherwise SQL Server will return an error.</p>
<p>e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">INDEX</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>IX_MyIndex<span style="color: #808080;">&#93;</span></pre></div></div>

<p> fails with &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Msg 3701, Level 11, State 6, Line XX
Cannot drop the index 'dbo.IX_MyIndex', 
because it does not exist or you do not have permission.</pre></div></div>

<p>However,</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">INDEX</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>MyTable<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>IX_MyIndex<span style="color: #808080;">&#93;</span></pre></div></div>

<p> will work fine if it exists and you have sufficient permissions.   (Use <code>Select user_name()</code> to determine your user context, which will help to verify the permissions being used.)</p>
]]></content:encoded>
			<wfw:commentRss>http://techencoder.com/index.php/2010/02/tsql-cannot-drop-theindex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
