adspace


How to add Foreign key in a table after the creation of the
table?

Answer Posted / subbu

You cannot add foreign key after creation of the table until
unless you have assigned the primary key while creating the
table. I mean without a primary key assigned for a table, we
cannot add foreign key.

Once the primary key is found, then query to add is been
already given by the above posters.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many tables will create when we create table, what are they? : Sql dba

1144


What is the best sql course?

1050


Do we need to rebuild index after truncate?

1137


Is primary key always clustered index?

1094


what is bcp? When does it used? : Sql dba

1055


what is collation? : Sql dba

1229


define sql insert statement ? : Sql dba

1098


What is the current version of sql?

1092


how to escape special characters in sql statements? : Sql dba

1113


how to start mysql server? : Sql dba

1266


what is sql server agent? : Sql dba

1182


Can we rollback truncate?

1074


what are the advantages of sql ? : Sql dba

1141


Is inner join faster than left join?

1274


What is the current version of postgresql?

1177