Loading ...
Sorry, an error occurred while loading the content.

How to get Table/View names used in an SP, or, SP's that have a Table/View refer

Expand Messages
  • DAMAKARUDU
    Hi I wonder, is there any help on getting all those table/views names that were being used in a SP. Let the tables be used for Select, Insert, Update... what
    Message 1 of 5 , Mar 24, 2008
    • 0 Attachment
      Hi

      I wonder, is there any help on getting all those table/views names
      that were being used in a SP. Let the tables be used for Select,
      Insert, Update... what ever.

      Similarly, is there any help on getting all those SP names that use a
      particular Table/view.

      Can anybody throw some light on this.

      Thanks & Regards
      Chakradhar
    • Brundaban Samal
      Hi, The below query will give you the list of SPs name uses the specific table like Test SELECT distinct name,xtype FROM syscomments sc INNER JOIN
      Message 2 of 5 , Mar 24, 2008
      • 0 Attachment
        Hi,

        The below query will give you the list of SPs name
        uses the specific table like "Test"

        SELECT distinct name,xtype
        FROM syscomments sc
        INNER JOIN sysobjects so on sc.id=so.id
        WHERE sc.text LIKE '%Test%'


        Brundaban

        --- DAMAKARUDU <damakarudu@...> wrote:

        > Hi
        >
        > I wonder, is there any help on getting all those
        > table/views names
        > that were being used in a SP. Let the tables be used
        > for Select,
        > Insert, Update... what ever.
        >
        > Similarly, is there any help on getting all those SP
        > names that use a
        > particular Table/view.
        >
        > Can anybody throw some light on this.
        >
        > Thanks & Regards
        > Chakradhar
        >
        >



        ____________________________________________________________________________________
        Never miss a thing. Make Yahoo your home page.
        http://www.yahoo.com/r/hs
      • arsalan
        What if the size of the stored procedure is really huge? Then I guess it is not completely stored in one position rather it is distributes across internally by
        Message 3 of 5 , Mar 24, 2008
        • 0 Attachment
          What if the size of the stored procedure is really huge?
          Then I guess it is not completely stored in one position rather it
          is distributes across internally by SQL.

          Arsalan

          --- In sqlcon@yahoogroups.com, Brundaban Samal <brundaban@...> wrote:
          >
          > Hi,
          >
          > The below query will give you the list of SPs name
          > uses the specific table like "Test"
          >
          > SELECT distinct name,xtype
          > FROM syscomments sc
          > INNER JOIN sysobjects so on sc.id=so.id
          > WHERE sc.text LIKE '%Test%'
          >
          >
          > Brundaban
          >
          > --- DAMAKARUDU <damakarudu@...> wrote:
          >
          > > Hi
          > >
          > > I wonder, is there any help on getting all those
          > > table/views names
          > > that were being used in a SP. Let the tables be used
          > > for Select,
          > > Insert, Update... what ever.
          > >
          > > Similarly, is there any help on getting all those SP
          > > names that use a
          > > particular Table/view.
          > >
          > > Can anybody throw some light on this.
          > >
          > > Thanks & Regards
          > > Chakradhar
          > >
          > >
          >
          >
          >
          >
          _____________________________________________________________________
          _______________
          > Never miss a thing. Make Yahoo your home page.
          > http://www.yahoo.com/r/hs
          >
        • Sandeep Chanda
          There are SQL dependency tracker utilities from Red Gate and Apex SQL software. You can use it to view dependencies. Regards, Sandeep Chanda From:
          Message 4 of 5 , Mar 24, 2008
          • 0 Attachment
            There are SQL dependency tracker utilities from Red Gate and Apex SQL software. You can use it to view dependencies.

            Regards,

            Sandeep Chanda

            From: sqlcon@yahoogroups.com [mailto:sqlcon@yahoogroups.com] On Behalf Of arsalan
            Sent: Monday, March 24, 2008 8:27 PM
            To: sqlcon@yahoogroups.com
            Subject: Re: MUGH-SQLCON How to get Table/View names used in an SP, or, SP's that have a Table/View refer


            What if the size of the stored procedure is really huge?
            Then I guess it is not completely stored in one position rather it
            is distributes across internally by SQL.

            Arsalan

            --- In sqlcon@yahoogroups.com<mailto:sqlcon%40yahoogroups.com>, Brundaban Samal <brundaban@...> wrote:
            >
            > Hi,
            >
            > The below query will give you the list of SPs name
            > uses the specific table like "Test"
            >
            > SELECT distinct name,xtype
            > FROM syscomments sc
            > INNER JOIN sysobjects so on sc.id=so.id
            > WHERE sc.text LIKE '%Test%'
            >
            >
            > Brundaban
            >
            > --- DAMAKARUDU <damakarudu@...> wrote:
            >
            > > Hi
            > >
            > > I wonder, is there any help on getting all those
            > > table/views names
            > > that were being used in a SP. Let the tables be used
            > > for Select,
            > > Insert, Update... what ever.
            > >
            > > Similarly, is there any help on getting all those SP
            > > names that use a
            > > particular Table/view.
            > >
            > > Can anybody throw some light on this.
            > >
            > > Thanks & Regards
            > > Chakradhar
            > >
            > >
            >
            >
            >
            >
            __________________________________________________________
            _______________
            > Never miss a thing. Make Yahoo your home page.
            > http://www.yahoo.com/r/hs
            >



            [Non-text portions of this message have been removed]
          • Madhu K Nair
            This is the one area where sql server 2008 has many enhancements. In earlier versions (2005,2000 etc) there are couple of system sps which gives these kind of
            Message 5 of 5 , Mar 30, 2008
            • 0 Attachment
              This is the one area where sql server 2008 has many enhancements. In
              earlier versions (2005,2000 etc) there are couple of system sps which
              gives these kind of dependency information but not complete. You may
              use sp_depends or sp_msdependencies(undocumented sp) to get
              dependency informations.

              Madhu

              --- In sqlcon@yahoogroups.com, "arsalan" <arsalanayub@...> wrote:
              >
              > What if the size of the stored procedure is really huge?
              > Then I guess it is not completely stored in one position rather it
              > is distributes across internally by SQL.
              >
              > Arsalan
              >
              > --- In sqlcon@yahoogroups.com, Brundaban Samal <brundaban@> wrote:
              > >
              > > Hi,
              > >
              > > The below query will give you the list of SPs name
              > > uses the specific table like "Test"
              > >
              > > SELECT distinct name,xtype
              > > FROM syscomments sc
              > > INNER JOIN sysobjects so on sc.id=so.id
              > > WHERE sc.text LIKE '%Test%'
              > >
              > >
              > > Brundaban
              > >
              > > --- DAMAKARUDU <damakarudu@> wrote:
              > >
              > > > Hi
              > > >
              > > > I wonder, is there any help on getting all those
              > > > table/views names
              > > > that were being used in a SP. Let the tables be used
              > > > for Select,
              > > > Insert, Update... what ever.
              > > >
              > > > Similarly, is there any help on getting all those SP
              > > > names that use a
              > > > particular Table/view.
              > > >
              > > > Can anybody throw some light on this.
              > > >
              > > > Thanks & Regards
              > > > Chakradhar
              > > >
              > > >
              > >
              > >
              > >
              > >
              >
              _____________________________________________________________________
              > _______________
              > > Never miss a thing. Make Yahoo your home page.
              > > http://www.yahoo.com/r/hs
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.