专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Asp教程 » 数据库存储过程:显示数据库中的存储过程 »正文

数据库存储过程:显示数据库中的存储过程

来源: 发布时间:星期四, 2008年9月25日 浏览:192次 评论:0
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 _disibledevent= 0;
}
while (!p.BOF && !p.EOF) {

//call the system stored procedure \"helptext\" which will return
//the exact text of the stored procedure, as entered by you...
//as a multiple recordset consisting of one field in each row.
//The name of the field is \"text\" and it\'s datatype is nVarChar(255).

相关文章

读者评论

  • 共0条 分0页

发表评论

  • 昵称:
  • 内容: