2007年8月9日星期四

【SQL SERVER】如何列出SQL数据库中的存储过程?

看看完整的代码(可自行添加其它功能):

< %@ LANGUAGE = VBScript % >

< HTML >
< HEAD >
< META NAME="GENERATOR" Content="Microsoft Developer Studio" >
< META HTTP-EQUIV="Content-Type"content="text/html; charset=gb2312" >

< TITLE >25175
SQL存储过程< /TITLE >
< /HEAD >

< %
On Error Resume Next
Dim oSQLServer
Set oSQLServer = CreateObject ("SQLOLE.SQLServer")

strServer = "dep"
strLogin = "sa"
strPwd = ""

oSQLServer.Connect strServer,strLogin,strPwd
% >

< BODY BGCOLOR=#ffffff >
< SELECT NAME="Database" >

' 数据库列表
< %
For Each SQLDB In oSQLServer.Databases
If Not SQLDB.SystemObject Then
Response.Write "< OPTION VALUE=""" & SQLDB.Name &amp; """ >" & SQLDB.Name &amp; " "

End If
Next
Set oSQLServer = Nothing
% >
< /SELECT >
< /BODY >
< /HTML >

没有评论: