Home Forums SQL Server 7,2000 T-SQL Find dependencies of an object across the database RE: Find dependencies of an object across the database

  • sp_depends is 100% accurate for tables functions and views. you cannot create any of those things with a dependency to another object unless the object exists.

    because of the way procedures are allowed to be created, it can be incorrect for procedures if

    1: the proc was created BEFORE the objects it uses were created.

    2. the proc uses dynamic SQL.

    if you recompile your procedures, you can fix #1 as the ALTER PROC syntax will put the dependencies back in for you if they were missing, but there's no way i know of to accurately get dynamic sql dependencies.

    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!