Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Today @ 11:31 AM
Points: 12,901, Visits: 32,136
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
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