Posted on: 2/23/2013 4:54:31 AM | Views : 1423

Dear 
i have create a table branch_mstr in which i have two coloum branch _no  and branch name 
where branch_no is primary key .
now i create a table acct_ mstr where i create a colum branch_no and i want to set it a foreign key from branch _mstr column branch_no.
send me the solution of that one it is simple but i cant excute it 
My Syntax is as follow.

create table acct_mstr( acct_no varchar (10) primary key, sf_no varchar (10), lf_no varchar (10), foreign key (branch_no) references branch_mstr(branch_no))
it give error
Msg 1769, Level 16, State 1, Line 1 Foreign key 'branch_no' references invalid column 'branch_no' in referencing table 'acct_mstr'. Msg 1750, Level 16, State 0, Line 1 Could not create constraint. See previous errors.
kindly help me in this issue AS SOON AS POSSIBLE
Regards 
Shubham

...

Go to the complete details ...