Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove a PK constraint in QA

Status
Not open for further replies.

cricketer1

Technical User
Mar 15, 2001
76
US
Can anyone help with the SQL to delete a PK constraint. Visually EM can handle this but I need to do this in QA.

Thanks,
Cricketer1
 
ALTER TABLE table_name DROP CONSTRAINT constraint_name


"Own only what you can carry with you; know language, know countries, know people. Let your memory be your travel bag.
 
Often you can perform the action in EM and script it. That is, make the change to the table, click the "save change script" button, and look at what it does.

Half the time, though, it does something you don't want such as create a duplicate of the table with the change, copy the data, delete the old table, and rename. However, i the process you'll see some of the syntax or keywords for addressing the item you're concerned with and can then look it up in Books Online.

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top