Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call a stored procedure in SQL server from ASP

Status
Not open for further replies.

didojove

Technical User
Jan 25, 2002
3
PH
Sorry, Im new on this.

After setting the database connection to an SQL server, what's the command for calling a stored procedure (named, let's say "crosstabs")?

thank you.
 
dim comObj
set comObj = server.createObject("ADODB.Command")
comObj.activeConnection = connection
comObj.commandType = 4 'adCmdStoredProcedure
comObj.commandText = "crosstabs"

comObj.parameters("@param1").value = value1
comObj.parameters("@param2").value = value2

comObj.execute

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top