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 2005 Forums
 Transact-SQL (2005)
 Unable to create relationship

Author  Topic 

herryzh
Starting Member

3 Posts

Posted - 2008-02-25 : 17:38:03
Hello,
When I try to save my database diagram I met the following error:

'tblGameEventType' table saved successfully
'tblPointAction' table
- Unable to create relationship 'FK_tblPointAction_tblGameEventType'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_tblPointAction_tblGameEventType". The conflict occurred in database "PlayTracKing", table "dbo.tblGameEventType", column 'GameEventTypeID'.


anyone knows something about that? thanks.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-02-25 : 17:40:23
Check out the error : its clearly mention on there
Go to Top of Page

herryzh
Starting Member

3 Posts

Posted - 2008-02-25 : 17:43:34
quote:
Originally posted by sodeep

Check out the error : its clearly mention on there


but there is not other constraint in dbo.tblGameEventType, why conflicted?
Go to Top of Page

herryzh
Starting Member

3 Posts

Posted - 2008-02-25 : 18:02:35
solved.
the problem is caused by the existing table data which broke the constraint. Just set checking existing data option as "NO" when create relationships.
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2008-02-25 : 19:21:59
In my book that has not solved anything at all. If anything you're just magnifying the problem and delaying the inevitable. If you are not going to enforce constraints then you may as well not have them.
Go to Top of Page
   

- Advertisement -