home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,174 of 19,505   
   Henk van den Berg to Bob Barrows   
   Re: Want to remove primary key   
   28 Mar 11 18:29:02   
   
   From: hvandenberg@xs4all.nl   
      
   And to find out the name_of_primary_key_constraint you can use this:   
   SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS   
         WHERE LOWER(TABLE_NAME) = 'ala' AND CONSTRAINT_TYPE = 'PRIMARY KEY'   
      
   Best,   
   Henk   
      
   On 28-03-2011 15:56, Bob Barrows wrote:   
   > mada suresh wrote:   
   >> Hi friends,   
   >>                   A pleasant greetings for one and all.I have the table   
   >> which name is ALA.It has a column id.i set id as primary key.Can any   
   >> one help me .please.   
   >>   
   >> i tried this query but no use,,,   
   >>   
   >> alter table ala drop primary key;   
   >   
   > ALTER TABLE dbo.ALA   
   >   DROP CONSTRAINT name_of_primary_key_constraint   
   >   
   > If relationships/foreign keys referencing this column exist, you will likely   
   > have to drop those as well.   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca