Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 1769 Alter table

Author  Topic 

kappa02
Yak Posting Veteran

65 Posts

Posted - 2008-01-14 : 16:37:20
When doing a alter table, I receive :

Msg 1769, Level 16, State 1, Line 3
Foreign key 'fkey_ID' references invalid column 'ID' in referencing table 'Account'.
Msg 1750, Level 16, State 0, Line 3

Could not create constraint. See previous errors.

ALTER TABLE APTIFY.dbo.Account
ADD CONSTRAINT fkey_ID FOREIGN KEY (ParentID) REFERENCES.dbo.Account(ID),
CONSTRAINT fkey_OrgCurrencyTypeID FOREIGN KEY (MoneyTypeID) REFERENCES dbo.MoneyType(ID)

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-01-14 : 17:12:43
- are you sure Account has the column [ID] ?
- did you add the [ID] column in the same batch as the alter (no "go" between statements) ?

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -