I have been programming in ASP using an Access database, and I am now migrating to SQL Server 2000. I want to replace the SQL queries I have been using with stored procedures. This this is an example of an SQL query I would use to return a recordset, where lngCartID is the parameter I now want to pass to a stored procedure:
Set rst = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblBussCarts.CartID, tblBussCarts.Created, tblBussCartItems.ProductID, tblBussCartItems.Quantity" _
& " FROM tblBussCartItems INNER JOIN tblBussCarts ON tblBussCartItems.CartID = tblBussCarts.CartID" _
& " WHERE tblCarts.CartID = " & lngCartID
rstT.Open strSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
I need to know how I would create this stored procedure in SQL Server (I'm assuming using Enterprise Manager), and how to call it with ADO in ASP.