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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 foreign key constraint

Author  Topic 

mdhingra01
Posting Yak Master

179 Posts

Posted - 2005-04-27 : 12:56:11
I am trying to add a foreign key constratint to a table Filecount but keep getting this error. I am able to add the constrint to other tables just not filecount. Anyone know why or what I should check?


Unable to create relationship 'FK_FILECOUNT_FACT_TIME_DIM'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_FILECOUNT_FACT_TIME_DIM'. The conflict occurred in database 'BI', table 'TIME_DIM', column 'TIME_KY'.

Thanks

mpetanovitch
Yak Posting Veteran

52 Posts

Posted - 2005-04-27 : 14:58:36
The filecount table probably has references that don't exist in the time_dim table. Specifically on the time_ky column.



Brought to you by:
BlackShoe Productions
Mike Petanovitch
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-04-27 : 15:16:11
Can we see the script that is attempting to create the key?

HTH

=================================================================
Every act of conscious learning requires the willingness to suffer an injury to one's self-esteem. That is why young children, before they are aware of their own self-importance, learn so easily; and why older persons, especially if vain or important, cannot learn at all. -Thomas Szasz, author, professor of psychiatry (1920- )
Go to Top of Page
   

- Advertisement -