Solved

SQL Server DBA

Posted on 2012-04-03
10
218 Views
Last Modified: 2012-04-10
Hello:

I have restored a database from a full backup and it restored just fine.
I can see the database and tables and data with in the table.

When I try to create a new Database diagram and select all the columns, it creates a diagram, BUT, the relationship lines between the tables do no show up.

Any idea how to get the lines to show?

Thank you,
Noa
0
Comment
Question by:noamco36
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 5

Assisted Solution

by:hafeezmca
hafeezmca earned 167 total points
ID: 37803276
Hi,

You can turn on relationship labels by right clicking in your diagram and select "Show Relationship Labels."
Hope this solution works for you.
0
 

Assisted Solution

by:jamesniox
jamesniox earned 250 total points
ID: 37803284
Hi Noa,
Did you check if your relationships always exists between your tables?
0
 

Author Comment

by:noamco36
ID: 37803423
I dont know.
the is what I have:
I received a SQL db full backup from offsite and restored it on my local machine.
Then I created  the Database diagram in SSMS , but cant see any lines between the tables.
Could it be that the database/tables dont have relationships to begin with?
But this would not make sense, I mean who would create a database that has no relationships in its tables?
0
 

Author Comment

by:noamco36
ID: 37803446
When will the lines appear in the diagram?
If the there PKs or FKs or Any Key?
0
 
LVL 5

Assisted Solution

by:hafeezmca
hafeezmca earned 167 total points
ID: 37804988
You should have both primay and foreign key defined.
Relationship works between Primay & Foreign keys.
You cant have a foreign key unless you have defined the primary key.
In case if you want to learn how to create the relationships then check out the below link:

http://weblogs.asp.net/brijmohan/archive/2010/06/05/creating-a-table-relationship-using-sql-server-2008-management-studio.aspx
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 83 total points
ID: 37809010
But this would not make sense, I mean who would create a database that has no relationships in its tables?
You would be amazed...

But suffice to say if you restored a true backup for the database and it showed no relationships than you can only conclude that the source database does not have any.
0
 

Assisted Solution

by:jamesniox
jamesniox earned 250 total points
ID: 37827296
Hi Noa,
how is it going?
did you solve your issue?
0
 

Author Comment

by:noamco36
ID: 37828637
Hi jamesniox, thanks for checking back.

"Hi Noa,
Did you check if your relationships always exists between your tables?"

What I have is a full backup of the original db that came from a different server. when I restored it on my machine, I also generated a new diagram via SSMS and saw no FK relationship. that means that in the original database there were no relationships to begin with, correct?
Or could it be that whoever did the full backup on the original server somehow missed to include the FK relationships in the backup and this is why they restored as just indipendent (stand-alone) tables?
0
 

Accepted Solution

by:
jamesniox earned 250 total points
ID: 37828731
In my personal experience, I didn't meet a way to make a full backup while skipping FKs, it seems strange, or simply there were no FK.

In our data warehouse we do not create relationships between tables as far as they're aggregated and we don't need them for cubes, so yes, it is possible to make a database without FKs. It is a normal behavior into a data warehouse.

If possible ask to the author of this database how comes it happens, it could be an obvious reason, or may be something else.

Hope this'll help you.

Have a great week.
0
 

Author Comment

by:noamco36
ID: 37828912
Yeh, the author... go figure who that is...
I was just told "here is the db , go figure it out."

Anyways, it looks like I will have to stick with no FK for now.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now