SQL dependency

  • Is there any free script or software for SQL dependycy?

    Red-gate has one but need to purchase.

  • In SSMS, you can right click an object and select 'View Dependencies'.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • It works for me. Thanks.

  • Eric M Russell (7/25/2013)


    In SSMS, you can right click an object and select 'View Dependencies'.

    As far as I know, those dependencies are only within the database. If there are objects outside the database referencing objects inside the the database, they won't appear.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (7/25/2013)


    Eric M Russell (7/25/2013)


    In SSMS, you can right click an object and select 'View Dependencies'.

    As far as I know, those dependencies are only within the database. If there are objects outside the database referencing objects inside the the database, they won't appear.

    Someone earlier suggested a link to a script that queries system tables, but SQL Server doesn't keep track of cross-databse dependencies. For dependencies outside the database, the tool would have to perform T-SQL code parsing and analysis.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • at least in SQL2008 and above, for cross database or cross server references, references are at least tracked in the current database, but not enforced of course

    this query has two specific columns to peed peek at for non-nulls:

    referenced_server_name and referenced_database_name

    those get populated for non-dynamic SQL procedures, and for any other objects that get created automatically.

    SELECT objz.name,

    fn.*

    FROM sys.objects objz

    CROSS APPLY sys.dm_sql_referenced_entities(schema_name(schema_id) + '.' + objz.name,'OBJECT')fn

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply