to add foriegn key Constraint RRS feed

  • Question

  • I Have A table for which i have to add foriegn key Constraint pls explain me with code sample.

    Thursday, September 4, 2008 6:02 AM



    Code Snippet

    ALTER TABLE table_name
    ADD CONSTRAINT constarint_name FOREIGN KEY (column_name)
        REFERENCES refered_table_name (column_name) ;



    refered_table_name is the table whose primary_key you are referring.
    Thursday, September 4, 2008 6:13 AM