Relationship Creation Error


Author
Message
Ozzie Seda, Jr
Ozzie Seda, Jr
StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)
Group: Forum Members
Posts: 7, Visits: 12
I'm trying out the demo of the DDT and when I create a relationship between 2 tables and go to deploy to server I get the following error:

Creating relationship 'FK_relationship' failed.
Create failed for ForeignKey 'FK_relationship'.
An exception occurred while executing a Transact-SQL statement or batch.
Foreign key 'FK_relationship' references invalid table 'master table'.
Could not create constraint. See previous errors.

There are no previous errors.  I'm using SQL Server Express.  I've tried setting the relationship from both tables as parent child, child parent with the same results.

Any ideas?

Thanks,

Ozzie

Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, the error is actually coming from SQL Server because the defined relationship cannot be established.  To better help you I need a couple of things.  I need the structure of the parent and child (at least the primary keys and the foreign key fields) and how you have defined the foreign key relationship (and which table you defined this on).

Also, what master table reference is being made here?  Is this a table in your database named master?

Ozzie Seda, Jr
Ozzie Seda, Jr
StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)
Group: Forum Members
Posts: 7, Visits: 12

Here's what I'm trying to accomplish...nothing out of the ordinary.

Ozzie

Ozzie Seda, Jr
Ozzie Seda, Jr
StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)
Group: Forum Members
Posts: 7, Visits: 12
Also, I tried defining the relationship on each table individually, after deleting all tables and every thing on SQL Express, and still the same result.

Ozzie

Ozzie Seda, Jr
Ozzie Seda, Jr
StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)
Group: Forum Members
Posts: 7, Visits: 12
Creating relationship 'FK_Trade_TradeDivision' failed.
Create failed for ForeignKey 'FK_Trade_TradeDivision'.
An exception occurred while executing a Transact-SQL statement or batch.
Foreign key 'FK_Trade_TradeDivision' references invalid table 'Trade'.
Could not create constraint. See previous errors.

This is the message when I create the relationship on table 'Trade'.

When I create the relationship on table 'TradeDivision' I get the same message as above except it references invalid table 'TradeDivision'

Thanks

Ozzie

Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Then this is what you will do.  Make sure that all of your foreign keys are removed from the Trade and TradeDivision tables (just to start over).  Once this is done do the following:

  1. Select the TradeDivision table
  2. Open the Relationships Item underneath the TradeDivision table
  3. Create a new relationship
  4. Name the item something like Fk_TradeDivision_Trade
  5. Select the TradeDivisionID field for the parent
  6. Select the Trade table from the bottom combo
  7. Select the TradeDivisionID field on the bottom right combo
  8. If you already have data in the table that will break the relationship, you can turn off the Ensure data checkbox (top check)
  9. Set any cascade details
  10. Click OK
  11. Rebuild your package and redeploy

Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Try the last post I made and see if it will succesfully create the relationship.  If not, create your package file and post it as an attachment here and I will fix it and send it back to you so you can see how to create the relationship.
Ozzie Seda, Jr
Ozzie Seda, Jr
StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)StrataFrame Beginner (7 reputation)
Group: Forum Members
Posts: 7, Visits: 12
Attached is the pkg file.  I tried what you suggested on your last post, didn't work.

Ozzie

Attachments
bbadmin.pkg (134 views, 17.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Ozzie,

I will look at this some more.  I am having a hard time making this work in SQL Server (aside from the DDT).  There is a SQL Server rule that is being violated and I am going to have to take a closer look.  It will more than likely be Monday before I get back to you on this.

StrataFrame Team
S
StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
There was an error within the DBEngine assembly during the foreign key creation where certain schema names were not references properly during the foreign key creation.  We fixed it, and I will let you know when a new update is available containing the fix.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search