Displaying stored procedures in a database __ rpm
It's no easy trick-see stored procedures in a database programmatically with a scripting language like ASP. If you're using MS Access, you're out of luck. Access provides no-the-actual meat of a stored procedure although you can get the names of the procedures in th e database with the ADOX. Catalog COM object.
But, if you were using SQL Server (like you should is because you care about your data), you had a guaranteed to view All your stored procedures using the globally-available system objects:the built-in sysobjects system table and the Sp_he Lptext system stored procedure.
with a couple of simple loops, everything about your Stored procedures can is viewed and accessed programmatically in just a few lines. Here's the results of the function (I ' m allowing you to view the first few procedures only because this method can be Pret Ty Resource-intensive. If you want the complete list of procedures I with this site, you can get it here.) Here's how it looks when called:
CREATE PROCEDURE Sp_addadvertlink
(
@m1 DateTime,
@m2 DateTime,
@m3 VarChar (20),
@m4 VarChar (20),
@m5 VarChar (255),
@m6 VarChar (255),
@m7 VarChar (255),
@m8 VarChar (255)
)
As
INSERT into
Easyads
(
Display_date, Display_time, Display_month, Display_day,
Usr_ip_address, Usr_browser, Display_adname, Usr_referer
)
VALUES
(
@m1, @m2, @m3, @m4, @m5, @m6, @m7, @m8
)
create PROCEDURE sp_addmailrecip
(
@mIPAddr varchar (255),
@mEmailAddr varchar (255)
)
as
INSERT into
autoresponder
(
IPaddress, emailaddress
)
values
(
@mIPAddr, @mEmailAddr
)
CREATE PROCEDURE sp_addusraddr
(
@mUsr varchar (255),
@mFstNme varchar (255),
@mLastNme varchar (255),
@mAddr1 varchar (255),
@mAddr2 varchar (255),
@mcity varchar (255),
@mstate varchar (255),
@mzip varchar (255),
@mEmail varchar (255),
@mphone varchar (255),
@mfax varchar (255),
@mcell VarChar (255),
@mnotes text
)
as
INSERT into
dayplanneraddresses
(
usr, firstname, LastName, StreetAddress1, streetaddress2,
City, State, Zip, emailaddress, phone, fax, cell, notes
)
values
(
@mUsr, @mFstNme, @ Mlastnme, @mAddr1, @mAddr2, @mcity, @mstate,
@mzip, @mEmail, @mphone, @mfax, @mcell, @mnotes
)
------------------sysobjects.asp-------------Source program--------------
<% @ Language = JScript%>
<%
With (Response) {
Buffer = true;
Expires = 0;
Clear ();
}