最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
显示数据库中的存储过程__转
时间:2022-06-30 10:32:27 编辑:袖梨 来源:一聚教程网
It's no easy trick to 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 way to see the actual meat of a stored procedure although you can get the names of the procedures in the database with the ADOX.Catalog COM object.
But, if you are using SQL Server (like you should be because you care about your data), you have a guaranteed way to view all your stored procedures using two globally-available system objects: the built-in sysobjects system table and the sp_helptext system stored procedure.
With a couple of simple loops, everything about your stored procedures can be 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 pretty resource-intensive. If you want the complete list of procedures I use on 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),
相关文章
- 无畏契约源能行动尚勃勒实战 尚勃勒实战技巧分享 07-12
- 幻兽帕鲁碎岩龟值得捕捉吗 帕鲁碎岩龟捕捉介绍 07-12
- 王者荣耀司马懿连夜加强了什么-司马懿技能重做调整介绍 07-12
- PS如何调整色相和饱和度来美化风景图片? 07-12
- Win11电脑没有声音了怎么恢复?Win11一切正常就是没声音解决教程 07-12
- 幻兽帕鲁噬魂兽在哪捕捉 帕鲁噬魂兽捕捉地点介绍 07-12