ASP lists stored procedures in the SQL database (pubs database) and their examples

Source: Internet
Author: User
Stored Procedure | data | Database----The following statement lists the storage process in the database (pubs database)

Pubdatabase =osqlserver.databases ("pubs")
' oSQLServer is the SQL Server server object that was created earlier
For each dbsp in Pubdatabase.storedprocedures
Response.Write dbsp. Text
Next

----The results of the program running (Take the data table name):

----The results of the storage process:

----A complete small example of the source code attached (other features readers can join).

<%@ LANGUAGE = VBScript% >

< HTML >
< head >
< META name= "generator" content=
"Microsoft Developer Studio" >
< META http-equiv= "Content-type"
Content= "text/html; charset=gb2312 ">

< TITLE ></title >

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


strserver = "DEP"
Strlogin = "sa"
Strpwd = ""


Osqlserver.connect strserver,strlogin,strpwd


% >


< body bgcolor= #ffffff >
Database list
< select Name= "Database" >
<%
For each sqldb in osqlserver.databases
If not sqldb. SystemObject Then
Response.Write "< OPTION value=
"" "& Sqldb. Name & "" > "& Sqldb. Name

& ""
End If
Next
Set oSQLServer = Nothing
% >
</select >
</body >



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.