how to remove a foreign key for a table in sql server 2005

  • 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

  • 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!

  • Thank You Lowell

  • Hi Lowell,

    How to Add the constraint Again to the same table.

    Regards,

    Selvamariappan.c

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply