Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Stored Procedures 1

Status
Not open for further replies.

astrodestino

IS-IT--Management
Feb 19, 2005
179
AR
Hi!
I could create and drop stored procedures but to show the sp code I have to use:

sp_helptext urprocedurename

But, how can I use this command to retreive the stored procedure code and response.write it on my website page?

Tnx!!!
 
here you go:

Code:
<%
dim sql, conn
set rsObj= server.createobject("ADODB.recordset")
Set conn= Server.CreateObject("ADODB.Connection")

conn.ConnectionString = "your connection string"

conn.open
rsObj.open "sp_helptext sms", conn

Response.Write "<table border=1>"
    If Not rsObj.EOF Then
        Response.Write "<tr>"
        For x = 0 To rsObj.Fields.Count - 1
            Response.Write "<th>" & rsObj(x).Name & "</th>"
            Response.Flush()
        Next
        Response.Write "</tr>"
        
        Do While Not rsObj.EOF
            Response.Write "<tr>"
            For x = 0 To rsObj.Fields.Count - 1
                Response.Write "<td>" & rsObj(x)& "&nbsp;</td>"
            Next
            Response.Write "</tr>"
            rsObj.MoveNext
        Loop
    End If
    Response.Write "</table>"

'close all objects here

%>

-DNG
 
if you dont want to see lines...then you just change:

Response.Write "<table border=1>"

to

Response.Write "<table border=0>"


-DNG
 
Yes, I try it today and it worked! thank you very much for the help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top