Professional Documents
Culture Documents
Executing Store Procedure (SP) in ASP: An Example Is
Executing Store Procedure (SP) in ASP: An Example Is
Because stored procedures are stored within the DBMS, bandwidth and
execution time are reduced. This is because a single stored procedure
can execute a complex set of SQL statements.
With Store procedure we will store our entire business login inside the
database itself. So if we plan to migrate from one technology to
another say from classic ASP to .NET then we only need to change the
user interface reset of the business logic remain same.
set con = Server.CreateObject("ADODB.Connection")
con.Open strConnect
Set Comm = Server.CreateObject("ADODB.Command")
comm.ActiveConnection = con
comm.CommandText = "sqlstoredprocedurename"
comm.CommandType = adCmdStoredProc
comm.Parameters.Append comm.CreateParameter("ID" ,
adVarchar,adParamInput, 50, id)
comm.Parameters.Append comm.CreateParameter("PRODUCT", adVarchar,
adParamInput,50, producttype )
comm.Parameters.Append comm.CreateParameter("ACCOUNT", adVarchar,
adParamInput,100, "" )
comm.Parameters.Append comm.CreateParameter("O_Errors", adVarchar,
adParamOutput,50) 'output parameters
comm.Execute