?
Solved

is table used by an views

Posted on 2015-01-30
6
Medium Priority
?
46 Views
Last Modified: 2015-03-03
At some point, when I first started working with SQL Server, I got the idea that it might be beneficial to take several Access databases and migrate the data to SQL Server.  I had a set of tables which were common to several Access applications, so I figured I would put them into their own SQL Server database, but after a while I realized that separating the data from the Access applications was more trouble than it was worth, so I copied all of those tables into one database.

So, before I delete that common tables database, I would like to know if there is an easy way to identify object relationships within SQL Server.  Specifically, I need to know whether any of the tables in that database are being used in any of the views, stored procedures, or UDFs in either that database, or any of the other databases on that server.
0
Comment
Question by:Dale Fye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 40580692
In SSMS, click on table, then Right-click > View Dependancies > Objects that depend on [your table name]

Guessing there are a number of third-party tools, probably Redgate and Pragmatic Works DOCxPress, that have this automated in such a way that it'll generate for all objects.
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40580695
Starting with SQL 2008, you can use this view:

sys.sql_expression_dependencies
0
 
LVL 48

Author Comment

by:Dale Fye
ID: 40610127
Thanks, Jim.  That seems to work within a given database, but not across databases on the same server.

Scott,  can you provide an example of how to use that?  I've tried a couple of things, but nothing seems to work.

Dale
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 40610173
Correct.  SQL databases don't track outside-database dependancies.  That's kind of like saying 'List all the people in the world that have my phone number', there's no way of knowing unless you track it manually.

Pragmatic Works Doc xPress does this, but you have to load all of the db's / SSIS / SSRS / SSAS into 'the world' for it to tell you were the dependancies lie.

Of course, you can always rename the database and see who screams.

Good luck.
0
 
LVL 48

Author Closing Comment

by:Dale Fye
ID: 40642706
Thanks for that recommendation, JIm.  I'm going to use one of the several 3rd party apps.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 40642720
If you go with Pragmatic Works mention that I went bull riding at Cowboy Jack's in Minneapolis with Brian Knight and Graham Bless, and referred you to them.  Guessing it won't get you anything other than a couple of good yuks, although it'll keep me on their good side.

Thanks for the grade.  Good luck with your Easter Egg hunt.  -Jim
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

762 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