Link to home
Start Free TrialLog in
Avatar of Varun Gaur
Varun Gaur

asked on

My question from foreign key ?

If I try to add a Foreign key column in existing other tables then A  error is burned.

Msg 1769, Level 16, State 1, Line 62
Foreign key 'Cstaddress_id' references invalid column 'Cstaddress_id' in referencing table 'customer'.
Msg 1750, Level 16, State 0, Line 62
Could not create constraint or index. See previous errors.

So please give me the solution of this error.
Avatar of Nitin Sontakke
Nitin Sontakke
Flag of India image

May be you should shown the both table structures or at least the relevant portion of the structures, without which it becomes difficult to help.

Is there a primary key (not likely) or a unique key defined on column cstaddress_id on table customer?

Is the datatype of column cstaddress_id in both the tables is identical?

Please review and revert. Share more details if error continues...
Besides providing us with the table schemas, you should also provide us the command that you're trying to run to create the FK.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial