Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Viewing stored procedures

Viewing stored procedures

Scheduled Pinned Locked Moved Database
databasehelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Its due when
    wrote on last edited by
    #1

    Hi All, I was wondering if I could get some advice on this. What Im trying to do is view a stored procedure in an asp page. I dont know much about it and was wondering is it like displaying records in a table? Any help/links would be greatly appreciated. Thanks in advance Nic

    C 1 Reply Last reply
    0
    • I Its due when

      Hi All, I was wondering if I could get some advice on this. What Im trying to do is view a stored procedure in an asp page. I dont know much about it and was wondering is it like displaying records in a table? Any help/links would be greatly appreciated. Thanks in advance Nic

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Assuming you are talking about SQL Server 2000 (You didn't mention a database product - so the rest of this answer may not apply) you can perform a query like this:

      select * from syscomments
      inner join sysobjects on sysobjects.id = syscomments.id
      where xtype='P'

      Which will return all of the stored procedures and the their uncompiled source. Does this help?


      My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      S 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Assuming you are talking about SQL Server 2000 (You didn't mention a database product - so the rest of this answer may not apply) you can perform a query like this:

        select * from syscomments
        inner join sysobjects on sysobjects.id = syscomments.id
        where xtype='P'

        Which will return all of the stored procedures and the their uncompiled source. Does this help?


        My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

        S Offline
        S Offline
        Scott Serl
        wrote on last edited by
        #3

        Or using INFORMATION_SCHEMA:

        SELECT ROUTINE_DEFINITION
        FROM INFORMATION_SCHEMA.Routines
        WHERE ROUTINE_CATALOG = 'MyDatabaseName'
        AND ROUTINE_NAME = 'MyProcName'

        MS SQL Server will return NULL if the procedure has been encrypted.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups