stored procedures

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishalgupta
    New Member
    • Jun 2007
    • 47

    stored procedures

    how can i view the stored procedures defined previously in a given sql database (mdf file)?
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by vishalgupta
    how can i view the stored procedures defined previously in a given sql database (mdf file)?
    am not sure what do you mean by "defined previously", but you can view the actual code by doing a sp_helptext mystoredproc in a query analyzer. it will display the entire code UNLESS THE PROGRAMMER EXPLICITLY DEFINED AN ENCRYPTED CODE DURING CREATION OF THE SP.

    -- ck

    Comment

    • vishalgupta
      New Member
      • Jun 2007
      • 47

      #3
      by "defined previously" i mean that ...
      a friend of mine has given me a database with some tables and stored procedures
      i can use select * to view the tables ....but how do i see the stored procedures defined by him in the database???...g onna try ur command

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Originally posted by vishalgupta
        by "defined previously" i mean that ...
        a friend of mine has given me a database with some tables and stored procedures
        i can use select * to view the tables ....but how do i see the stored procedures defined by him in the database???...g onna try ur command

        try

        select * from sysobjects where xtype = 'P'

        it will list all user stored proc. since it will be created by dbo and someone can login as dbo, you can not really tell if he created it....i think....

        to view the code, you can still use sp_helptext. unless during creation of stored proc, it was specifically stated that it's encrypted

        -- ck

        Comment

        Working...