<?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; How to Drop Primary Key Contraint</title>
	<atom:link href="http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:40:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Sanjeev</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-167259</link>
		<dc:creator><![CDATA[Sanjeev]]></dc:creator>
		<pubDate>Sun, 11 Sep 2011 13:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-167259</guid>
		<description><![CDATA[consider oscommerce address book table. address has customer_id as MUL (ie, PRI and FK) properties and address_book_id as primary.
By mistake, auto_increment was not associated to any key. I want to make the address_book_id as auto_increament. Yes, i am able to do it. But the problem is existing values still have duplicates. How can i make it have auto_increamented values. Other option i found is, Drop the primary key from address_book. which is dropping both the fields. At the end i want address_book_id field to have auto_increament values. Please suggest]]></description>
		<content:encoded><![CDATA[<p>consider oscommerce address book table. address has customer_id as MUL (ie, PRI and FK) properties and address_book_id as primary.<br />
By mistake, auto_increment was not associated to any key. I want to make the address_book_id as auto_increament. Yes, i am able to do it. But the problem is existing values still have duplicates. How can i make it have auto_increamented values. Other option i found is, Drop the primary key from address_book. which is dropping both the fields. At the end i want address_book_id field to have auto_increament values. Please suggest</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhagyalakshmi V G</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-155742</link>
		<dc:creator><![CDATA[Bhagyalakshmi V G]]></dc:creator>
		<pubDate>Wed, 10 Aug 2011 10:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-155742</guid>
		<description><![CDATA[Is it possible to drop UNIQUE key constraint in SQL Server? i was not able to do so...]]></description>
		<content:encoded><![CDATA[<p>Is it possible to drop UNIQUE key constraint in SQL Server? i was not able to do so&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhagyalakshmi V G</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-155741</link>
		<dc:creator><![CDATA[Bhagyalakshmi V G]]></dc:creator>
		<pubDate>Wed, 10 Aug 2011 10:08:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-155741</guid>
		<description><![CDATA[ya i got answer from this page. thank you sir]]></description>
		<content:encoded><![CDATA[<p>ya i got answer from this page. thank you sir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: icon_5000</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-151250</link>
		<dc:creator><![CDATA[icon_5000]]></dc:creator>
		<pubDate>Thu, 28 Jul 2011 06:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-151250</guid>
		<description><![CDATA[Hi Pinal,

I need your help with sql server 2005. I want to insert a running clock in any table where it will auto increment. So once set this clock cannot be changed. Just one row with two columns Time, Current time. Time column is just a ref. Can be an int as well but current time should auto increment every second. I need it to be a clock inside sql.

Any help is sincerely appreciated.

icon_5000]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I need your help with sql server 2005. I want to insert a running clock in any table where it will auto increment. So once set this clock cannot be changed. Just one row with two columns Time, Current time. Time column is just a ref. Can be an int as well but current time should auto increment every second. I need it to be a clock inside sql.</p>
<p>Any help is sincerely appreciated.</p>
<p>icon_5000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-138368</link>
		<dc:creator><![CDATA[Manoj]]></dc:creator>
		<pubDate>Thu, 02 Jun 2011 09:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-138368</guid>
		<description><![CDATA[Hey Richard,

Did you get answer to your query? I am in a similar scenario, although in my case, the size is many times more - about 200 million records. Please let me know if you figured out what is taking so long. Our process has been running for more than 6 hours.

Also, what would happen if I stop this running operation - note that this drop constraint statement itself is NOT explicitly enclosed in a BEGIN TRAN - END TRAN block.

Thanks,
Manoj Deshpande.]]></description>
		<content:encoded><![CDATA[<p>Hey Richard,</p>
<p>Did you get answer to your query? I am in a similar scenario, although in my case, the size is many times more &#8211; about 200 million records. Please let me know if you figured out what is taking so long. Our process has been running for more than 6 hours.</p>
<p>Also, what would happen if I stop this running operation &#8211; note that this drop constraint statement itself is NOT explicitly enclosed in a BEGIN TRAN &#8211; END TRAN block.</p>
<p>Thanks,<br />
Manoj Deshpande.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: icon_5000</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-127601</link>
		<dc:creator><![CDATA[icon_5000]]></dc:creator>
		<pubDate>Fri, 08 Apr 2011 09:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-127601</guid>
		<description><![CDATA[DBCC checktable error....

Msg 8967, Level 16, State 218, Line 1
An internal error occurred in DBCC that prevented further processing. Contact Customer Support Services.
Msg 8944, Level 16, State 13, Line 1
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 262144 (type Unknown), page (1:135), row 57. Test (ColumnOffsets &lt;= (nextRec - pRec)) failed. Values are 293 and 37.
Msg 7985, Level 16, State 2, Line 1
System table pre-checks: Object ID 4. Could not read and latch page (1:135) with latch type SH. Check statement terminated due to unrepairable error.]]></description>
		<content:encoded><![CDATA[<p>DBCC checktable error&#8230;.</p>
<p>Msg 8967, Level 16, State 218, Line 1<br />
An internal error occurred in DBCC that prevented further processing. Contact Customer Support Services.<br />
Msg 8944, Level 16, State 13, Line 1<br />
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 262144 (type Unknown), page (1:135), row 57. Test (ColumnOffsets &lt;= (nextRec &#8211; pRec)) failed. Values are 293 and 37.<br />
Msg 7985, Level 16, State 2, Line 1<br />
System table pre-checks: Object ID 4. Could not read and latch page (1:135) with latch type SH. Check statement terminated due to unrepairable error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: icon_5000</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-127597</link>
		<dc:creator><![CDATA[icon_5000]]></dc:creator>
		<pubDate>Fri, 08 Apr 2011 08:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-127597</guid>
		<description><![CDATA[Hi, 

when i run a select * from table1 it gives me a error

&quot;
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
&quot;

But when i select the first column like select A from table1 it displays the first column. Also count gives the total count of the rows.
But when u do Select * or apart from first column &#039;A&#039; any column i get the above error.

Whats been done with no success....
DBCC checktable ...same above error
DBCC Checkdb ...same above error
Started DB in emergency mode and tried
Created a new db and tried to copy the data but could not copy...may be i was doing something wrong. But corrupt table schema got copied but not the data.
deleted the primary and also droped the index.
Possibly a index corrupt issue. When i try sysindexes i get the same error same.

Since the one column can be read ...i m pretty optimistic that the data could be recovered

Any help will be sincerely appreciated.]]></description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>when i run a select * from table1 it gives me a error</p>
<p>&#8221;<br />
Msg 0, Level 11, State 0, Line 0<br />
A severe error occurred on the current command.  The results, if any, should be discarded.<br />
Msg 0, Level 20, State 0, Line 0<br />
A severe error occurred on the current command.  The results, if any, should be discarded.<br />
&#8221;</p>
<p>But when i select the first column like select A from table1 it displays the first column. Also count gives the total count of the rows.<br />
But when u do Select * or apart from first column &#8216;A&#8217; any column i get the above error.</p>
<p>Whats been done with no success&#8230;.<br />
DBCC checktable &#8230;same above error<br />
DBCC Checkdb &#8230;same above error<br />
Started DB in emergency mode and tried<br />
Created a new db and tried to copy the data but could not copy&#8230;may be i was doing something wrong. But corrupt table schema got copied but not the data.<br />
deleted the primary and also droped the index.<br />
Possibly a index corrupt issue. When i try sysindexes i get the same error same.</p>
<p>Since the one column can be read &#8230;i m pretty optimistic that the data could be recovered</p>
<p>Any help will be sincerely appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Hansell</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-126478</link>
		<dc:creator><![CDATA[Richard Hansell]]></dc:creator>
		<pubDate>Mon, 04 Apr 2011 09:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-126478</guid>
		<description><![CDATA[I have a very large table (37.5 million rows) and am currently dropping the Primary Key as it wasn&#039;t well designed.  I would have expected this to be a quite rapid operation but it has been running now for 20 minutes with no sign of finishing.

Is it going to reorganise all the data in the table because of me dropping the Primary Key?  I assume this is what it is doing as I can&#039;t think of any reason why else it would take so long to just drop a constraint.]]></description>
		<content:encoded><![CDATA[<p>I have a very large table (37.5 million rows) and am currently dropping the Primary Key as it wasn&#8217;t well designed.  I would have expected this to be a quite rapid operation but it has been running now for 20 minutes with no sign of finishing.</p>
<p>Is it going to reorganise all the data in the table because of me dropping the Primary Key?  I assume this is what it is doing as I can&#8217;t think of any reason why else it would take so long to just drop a constraint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-123289</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 15 Mar 2011 08:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-123289</guid>
		<description><![CDATA[You can also know it from the result opf 

exec sp_help &#039;table_name&#039;]]></description>
		<content:encoded><![CDATA[<p>You can also know it from the result opf </p>
<p>exec sp_help &#8216;table_name&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinoth</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-123139</link>
		<dc:creator><![CDATA[Vinoth]]></dc:creator>
		<pubDate>Mon, 14 Mar 2011 04:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-123139</guid>
		<description><![CDATA[Hi!!!

if you want to know the constraint name just violate the primary key by try to insert the same values in table.

Which shows the constraint name.


like this

Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint &#039;pk_addcons&#039;. Cannot insert duplicate key in object &#039;dbo.ADDCONS&#039;.
The statement has been terminated.

here pk_addcons is the constraint name..]]></description>
		<content:encoded><![CDATA[<p>Hi!!!</p>
<p>if you want to know the constraint name just violate the primary key by try to insert the same values in table.</p>
<p>Which shows the constraint name.</p>
<p>like this</p>
<p>Msg 2627, Level 14, State 1, Line 1<br />
Violation of PRIMARY KEY constraint &#8216;pk_addcons&#8217;. Cannot insert duplicate key in object &#8216;dbo.ADDCONS&#8217;.<br />
The statement has been terminated.</p>
<p>here pk_addcons is the constraint name..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Stagers</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-117238</link>
		<dc:creator><![CDATA[Zach Stagers]]></dc:creator>
		<pubDate>Tue, 08 Feb 2011 13:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-117238</guid>
		<description><![CDATA[Thanks for the post Pinal.

I used Sung&#039;s method of finding the name of the primary key, and it worked like a charm.

Thanks again.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the post Pinal.</p>
<p>I used Sung&#8217;s method of finding the name of the primary key, and it worked like a charm.</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-111715</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 18 Jan 2011 15:28:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-111715</guid>
		<description><![CDATA[Just omit the default column in the INSERT statement and dont pass value to it]]></description>
		<content:encoded><![CDATA[<p>Just omit the default column in the INSERT statement and dont pass value to it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshu Verma</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-111630</link>
		<dc:creator><![CDATA[Anshu Verma]]></dc:creator>
		<pubDate>Tue, 18 Jan 2011 11:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-111630</guid>
		<description><![CDATA[Hi Pinal Sir,
                 Thanks for &quot;How to drop foreign key Constraints&quot;.
Plz tell me how to insert default value through default constraint.I have created table below:
Create Table Product
(
PID INT CONSTRAINT T PRIMARY KEY(PID,PNAME),
PNAME NCHAR(25),
PPRICE INT,
PCOLOR NCHAR(8) CONSTRAINT C CHECK(PCOLOR IN(&#039;WHITE&#039;,&#039;BLACK&#039;,&#039;RED&#039;,&#039;BLUE&#039;,&#039;GREEN&#039;,&#039;VOILET&#039;,&#039;YELLOW&#039;,&#039;ORANGE&#039;))CONSTRAINT C1 DEFAULT &#039;WHITE&#039; 
)

But I m unable to insert the default value.
                                                 
Anshu Verma]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal Sir,<br />
                 Thanks for &#8220;How to drop foreign key Constraints&#8221;.<br />
Plz tell me how to insert default value through default constraint.I have created table below:<br />
Create Table Product<br />
(<br />
PID INT CONSTRAINT T PRIMARY KEY(PID,PNAME),<br />
PNAME NCHAR(25),<br />
PPRICE INT,<br />
PCOLOR NCHAR(8) CONSTRAINT C CHECK(PCOLOR IN(&#8216;WHITE&#8217;,'BLACK&#8217;,'RED&#8217;,'BLUE&#8217;,'GREEN&#8217;,'VOILET&#8217;,'YELLOW&#8217;,'ORANGE&#8217;))CONSTRAINT C1 DEFAULT &#8216;WHITE&#8217;<br />
)</p>
<p>But I m unable to insert the default value.</p>
<p>Anshu Verma</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shivkatoch</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-96406</link>
		<dc:creator><![CDATA[shivkatoch]]></dc:creator>
		<pubDate>Fri, 29 Oct 2010 04:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-96406</guid>
		<description><![CDATA[hello.. i am a begineer and i want to know more about sql and mysql.. what&#039;s major difference between them and if anyone can help me in giving some tutorials on sql.]]></description>
		<content:encoded><![CDATA[<p>hello.. i am a begineer and i want to know more about sql and mysql.. what&#8217;s major difference between them and if anyone can help me in giving some tutorials on sql.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Demirev</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-88794</link>
		<dc:creator><![CDATA[Vladimir Demirev]]></dc:creator>
		<pubDate>Tue, 21 Sep 2010 13:01:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-88794</guid>
		<description><![CDATA[ALTER TABLE Table1
DROP PRIMARY KEY


works in Oracle, along with &quot;...DROP CONSTRAINT&quot;]]></description>
		<content:encoded><![CDATA[<p>ALTER TABLE Table1<br />
DROP PRIMARY KEY</p>
<p>works in Oracle, along with &#8220;&#8230;DROP CONSTRAINT&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-86632</link>
		<dc:creator><![CDATA[Henry]]></dc:creator>
		<pubDate>Sun, 05 Sep 2010 03:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-86632</guid>
		<description><![CDATA[Hi, your blog is interesting, I came here by looking how to drop a primary unique key, but I have a problem and I don&#039;t know how to fix it. Let me explain:

I had a table named tblPagos with primary unique key column &quot;idPago&quot;
Due to some problems, it was impossible at least to me to make an update using a join from other table, so I decide to rename the table to &quot;tblPagosOld&quot; and create a new tblPagos, so, now I have two tables: tblPagos and tblPagosOld

I made an insert in the new tblPagos by selecting data from tblPagosOld and doing an inner join from a master table

After that I drop the table tblPagosOld
Now I want to create a primary unique key for column &quot;idPago&quot; from the new tblPagos but SQL Server tells me that there&#039;s a duplicate PK_tblPagos and tell me the object id (the old one) and I can&#039;t find where is the reference to that PK 

I was taking a look at the database diagram, also I was trying to make a new primary key using a different name, in addition I was looking for it on sys.indexes, sys.contraints, also I was trying to run the script by using &quot;alter table tblPagos&quot; and executing the drop

There&#039;s some option? there&#039;s something I&#039;m not seeing? any help it could be appreciate]]></description>
		<content:encoded><![CDATA[<p>Hi, your blog is interesting, I came here by looking how to drop a primary unique key, but I have a problem and I don&#8217;t know how to fix it. Let me explain:</p>
<p>I had a table named tblPagos with primary unique key column &#8220;idPago&#8221;<br />
Due to some problems, it was impossible at least to me to make an update using a join from other table, so I decide to rename the table to &#8220;tblPagosOld&#8221; and create a new tblPagos, so, now I have two tables: tblPagos and tblPagosOld</p>
<p>I made an insert in the new tblPagos by selecting data from tblPagosOld and doing an inner join from a master table</p>
<p>After that I drop the table tblPagosOld<br />
Now I want to create a primary unique key for column &#8220;idPago&#8221; from the new tblPagos but SQL Server tells me that there&#8217;s a duplicate PK_tblPagos and tell me the object id (the old one) and I can&#8217;t find where is the reference to that PK </p>
<p>I was taking a look at the database diagram, also I was trying to make a new primary key using a different name, in addition I was looking for it on sys.indexes, sys.contraints, also I was trying to run the script by using &#8220;alter table tblPagos&#8221; and executing the drop</p>
<p>There&#8217;s some option? there&#8217;s something I&#8217;m not seeing? any help it could be appreciate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajesh</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-75206</link>
		<dc:creator><![CDATA[rajesh]]></dc:creator>
		<pubDate>Tue, 08 Jun 2010 15:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-75206</guid>
		<description><![CDATA[I tried the script that you have mentioned but getting this error&quot;.Net SqlClient Data Provider: Msg 3728, Level 16, State 1, Line 2
&#039;PK_XXXXX&#039; is not a constraint.
.Net SqlClient Data Provider: Msg 3727, Level 16, State 0, Line 2
Could not drop constraint. See previous errors.&quot;

I am sure that a PK constraint is existing on the table.]]></description>
		<content:encoded><![CDATA[<p>I tried the script that you have mentioned but getting this error&#8221;.Net SqlClient Data Provider: Msg 3728, Level 16, State 1, Line 2<br />
&#8216;PK_XXXXX&#8217; is not a constraint.<br />
.Net SqlClient Data Provider: Msg 3727, Level 16, State 0, Line 2<br />
Could not drop constraint. See previous errors.&#8221;</p>
<p>I am sure that a PK constraint is existing on the table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rahul</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-64347</link>
		<dc:creator><![CDATA[rahul]]></dc:creator>
		<pubDate>Sat, 03 Apr 2010 00:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-64347</guid>
		<description><![CDATA[Where should I execute the script?]]></description>
		<content:encoded><![CDATA[<p>Where should I execute the script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-62969</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Mon, 15 Mar 2010 17:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-62969</guid>
		<description><![CDATA[Hello Ankit,

Know the primary key name from sp_help. Primary key constraint name would be different than column name.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hello Ankit,</p>
<p>Know the primary key name from sp_help. Primary key constraint name would be different than column name.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankit gusani</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-62921</link>
		<dc:creator><![CDATA[Ankit gusani]]></dc:creator>
		<pubDate>Mon, 15 Mar 2010 06:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-62921</guid>
		<description><![CDATA[Hello Pinal Sir,


Thank You For Replying



As You Right that primary key name is different than pk_id but  my database not having any foreign key and only one id field that&#039;s name is pk_id.

my database table having following structure
Table Name: Table_Test

Fields Name                 Datatype

pk_id                            int
name                           varchar(50)
address                       varchar(50)



where I set pk_id is as primary key.


So, Help me to drop the primary key using query.


This is only sample table that I am trying to remove but this same process I have to done in many problem.



So,
Please Reply Me.



Ankit Gusani]]></description>
		<content:encoded><![CDATA[<p>Hello Pinal Sir,</p>
<p>Thank You For Replying</p>
<p>As You Right that primary key name is different than pk_id but  my database not having any foreign key and only one id field that&#8217;s name is pk_id.</p>
<p>my database table having following structure<br />
Table Name: Table_Test</p>
<p>Fields Name                 Datatype</p>
<p>pk_id                            int<br />
name                           varchar(50)<br />
address                       varchar(50)</p>
<p>where I set pk_id is as primary key.</p>
<p>So, Help me to drop the primary key using query.</p>
<p>This is only sample table that I am trying to remove but this same process I have to done in many problem.</p>
<p>So,<br />
Please Reply Me.</p>
<p>Ankit Gusani</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-62879</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 17:11:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-62879</guid>
		<description><![CDATA[Hello Ankit,

The error indecates that the primary key name is different than pk_id. Before dropping primary key constraint you will have to drop all foreign key constraints also.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hello Ankit,</p>
<p>The error indecates that the primary key name is different than pk_id. Before dropping primary key constraint you will have to drop all foreign key constraints also.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankit gusani</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-62854</link>
		<dc:creator><![CDATA[Ankit gusani]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 07:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-62854</guid>
		<description><![CDATA[Hi 


I have to remove primary key from multiple table. 

so I use a following query for it: 

ALTER TABLE table_name 
DROP CONSTRAINT pk_id;


it is a give a error like:
Msg 3728, Level 16, State 1, Line 1
&#039;pk_id&#039; is not a constraint.
Msg 3727, Level 16, State 0, Line 1
Could not drop constraint. See previous errors.


please helm me for this error.


I am using a SQL SERVER 2005 express Edition.


Ankit Gusani.]]></description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I have to remove primary key from multiple table. </p>
<p>so I use a following query for it: </p>
<p>ALTER TABLE table_name<br />
DROP CONSTRAINT pk_id;</p>
<p>it is a give a error like:<br />
Msg 3728, Level 16, State 1, Line 1<br />
&#8216;pk_id&#8217; is not a constraint.<br />
Msg 3727, Level 16, State 0, Line 1<br />
Could not drop constraint. See previous errors.</p>
<p>please helm me for this error.</p>
<p>I am using a SQL SERVER 2005 express Edition.</p>
<p>Ankit Gusani.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rizwan</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-59944</link>
		<dc:creator><![CDATA[rizwan]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 16:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-59944</guid>
		<description><![CDATA[no well this meter]]></description>
		<content:encoded><![CDATA[<p>no well this meter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Braj</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-57554</link>
		<dc:creator><![CDATA[Braj]]></dc:creator>
		<pubDate>Thu, 12 Nov 2009 15:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-57554</guid>
		<description><![CDATA[Imran Mohammed&#039;s answer(SQL) has solved my problem.
Thanx]]></description>
		<content:encoded><![CDATA[<p>Imran Mohammed&#8217;s answer(SQL) has solved my problem.<br />
Thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sung Meister</title>
		<link>http://blog.sqlauthority.com/2009/05/12/sql-server-how-to-drop-primary-key-contraint/#comment-56380</link>
		<dc:creator><![CDATA[Sung Meister]]></dc:creator>
		<pubDate>Sat, 03 Oct 2009 15:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4555#comment-56380</guid>
		<description><![CDATA[I have been trying to drop primary key constraint by using &quot;drop index&quot;...

This post guided me to a right direction.

Microsoft usually tries their best to ease the pain of development or maintenance for developers or IT professionals by introducing easier way to do stuff.

But for dropping primary key constraint, IMHO, MySQL wins.]]></description>
		<content:encoded><![CDATA[<p>I have been trying to drop primary key constraint by using &#8220;drop index&#8221;&#8230;</p>
<p>This post guided me to a right direction.</p>
<p>Microsoft usually tries their best to ease the pain of development or maintenance for developers or IT professionals by introducing easier way to do stuff.</p>
<p>But for dropping primary key constraint, IMHO, MySQL wins.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

