Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to remove a foreign key for a table in sql server 2005 Expand / Collapse
Author
Message
Posted Tuesday, February 10, 2009 5:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 26, 2009 10:06 PM
Points: 7, Visits: 16
Hi All ,

I am i need of how to remove a foreign key for a table in sql server 2005,
Please tell the query for it
Thanks and Regards
Sevamariappan.c
Post #653573
Posted Tuesday, February 10, 2009 5:10 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 4:13 PM
Points: 14,444, Visits: 37,856
sp_help the table, and find the name of the Foreign key you want to drop.
issue the drop command like this:

sp_help gmact
alter table gmact drop constraint FK__GMACT__AACCOMPLT__66960AE6



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #653582
Posted Tuesday, February 10, 2009 6:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 26, 2009 10:06 PM
Points: 7, Visits: 16

Thank You Lowell
Post #653607
Posted Tuesday, February 10, 2009 10:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 26, 2009 10:06 PM
Points: 7, Visits: 16
Hi Lowell,
How to Add the constraint Again to the same table.
Regards,
Selvamariappan.c
Post #654411
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse