Re: Finding tables referenced in a Stored Procedure

From: Maria (anonymous_at_discussions.microsoft.com)
Date: 06/14/04

  • Next message: Billz89: "Finding non-duplicate records?"
    Date: Mon, 14 Jun 2004 02:44:23 -0700
    
    

    Thank you!

    >-----Original Message-----
    >Hi,
    >
    >You can use the system procedure SP_DEPENDS. But
    References to objects
    >outside the current database are not reported.
    >
    >use <dbname>
    >go
    >sp_depends <procedure_name>
    >
    >Sp_depends - Displays information about database object
    dependencies (for
    >example, the views and procedures that depend on a table
    or view, and the
    >tables and views that are depended on by the view or
    procedure).
    >
    >--
    >Thanks
    >Hari
    >MCDBA
    >"Maria" <anonymous@discussions.microsoft.com> wrote in
    message
    >news:1b67401c44fb7$3f918f50$a001280a@phx.gbl...
    >> Hello!
    >>
    >> I'm in desperate need of some help. I am trying to
    >> identify db objects that are no longer in use. i have a
    >> list of sp's that are not being used, and i'm trying to
    >> look in the body text of the sp (by querying the text
    >> field in syscomments) to find references to tables and
    >> views. these will essentially be tables and views that
    are
    >> being referenced by unused sp's. My query looks like
    this:
    >>
    >> select [id] from syscomments
    >> where [id] = 164299745 and [text] LIKE '%TimeSeries%'
    >>
    >> The problem is: if there are any columns with a similar
    >> name to the table name (i.e. TimeSeriesID) this will be
    >> returned in my result set. there are thousands of sp's
    >> being returned so trawling through them is going to take
    >> ages. Anybody know of a quick way of finding out which
    >> tables and view are being referenced by a stored
    procedure?
    >>
    >> Any help at all will be very much appreciated!
    >>
    >> Maria
    >
    >
    >.
    >


  • Next message: Billz89: "Finding non-duplicate records?"

    Relevant Pages

    • Dependencies vs. Merge Modules
      ... Whenever I create a Setup Project for an application I'm working on, ... Visual Studio automatically detects that application's dependencies. ... the application project's References folder. ... a collection of DLLs) are distributed. ...
      (microsoft.public.vsnet.general)
    • Re: After Package Install Error
      ... all existing macros to code. ... The problem we most encounter re: references is with MDAC ... >You say that you've included all dependencies, however, ... >> We have developed a demo version of a database. ...
      (microsoft.public.access.devtoolkits)
    • Re: Huge project - long build time
      ... If you use Project References the Project Dependencies are set ... automatically, if you use DLL References, then you can manually create the ... The problem is that the compiler tells me it cannot ...
      (microsoft.public.dotnet.general)
    • Re: reference or dependency
      ... References are stored in the project, while dependencies are stored in the ... I want to use a library, but do not care what other libraries it uses. ... Serge Desmedt ...
      (microsoft.public.vc.ide_general)
    • Re: Export all classes in call graph?
      ... "Dependencies from," to see all the class referenced from that package. ... Jars within jars are not analysed. ... Class files are not guaranteed to hold references to all the classes ...
      (comp.lang.java.programmer)