Re: Finding tables referenced in a Stored Procedure

From: Hari (hari_prasad_k_at_hotmail.com)
Date: 06/12/04

  • Next message: Bryan: "Access Format Equivalent"
    Date: Sun, 13 Jun 2004 00:27:33 +0530
    
    

    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: Bryan: "Access Format Equivalent"

    Relevant Pages

    • Re: Table Design Question
      ... > requires more than two probes, no matter how large the database. ... > acceptable (in the relational model) to have an Identity attribute to ... the gap in the sequence is not filled in and the sequence ... > vin CHARNOT NULL REFERENCES Motorpool); ...
      (microsoft.public.sqlserver.programming)
    • Re: Mixed up with Relationships..help!
      ... The database you're describing ... The CONSTRAINT statement establishes a Primary Key or a Foreign Key, ... "REFERENCES" table and column. ... QuestionaireAnswers: QuestionaireAnswersID, StudentID, 2005, ...
      (microsoft.public.access.gettingstarted)
    • Re: One PC not able to calculate formulas
      ... Are you using ONE database on a server that everyone is accessing? ... If you get no errors then select Tools: References ... Then check the reference libraries on that computer. ... If any of the selected references have "MISSING:" in front of them, unselect ...
      (microsoft.public.access.gettingstarted)
    • Re: Newbie question on table design.
      ... The early SQL systems were also ... built on a queues and locking model because that is what we had. ... a row is defined in the database ... REFERENCES clause on the Orders table which references the Inventory ...
      (comp.databases.theory)
    • Re: table structure question
      ... no matter how large the database. ... acceptable (in the relational model) to have an Identity attribute to ... the gap in the sequence is not filled in and the sequence ... vin CHARNOT NULL REFERENCES Motorpool); ...
      (microsoft.public.sqlserver.programming)