Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Database Mapping error

$
0
0

Hi 

I am actually trying to make relationships in an already designed database..
Database is historic one and no proper relationships, I could find 3 PK's and 0 FK's. I am doing it in test database which lives in Prod and which the data is already there.

My requirement is I have to make a Database Diagram by assigning proper constraints. I had to find out 1100 common columns in 158 tables and I was able to make relationships for very few tables but not all of them.

Following are the errors while saving 

..............
- Unable to create relationship 'FK_tblStatTenancyInfo_tblStatInfo'.  
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_tblStatTenancyInfo_tblStatInfo". The conflict occurred in database "HFSMart", table "dbo.tblStatInfo", column 'StatTenancyAddress'.


This is an example error and is occurring for all other tables whenever I make relationships. I'm sure There are no keys before making relationships but still it's getting conflicted.

Please note I am making relationships in already existence database which is a copy of production database and data is already there. 

Do you think this error causes because of the data already exists or any idea for the better solution.  

Could any one respond to my query ASAP as I am facing similar errors for all the tables..

Many Thanks...


Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>