I know this is got to be basic but i cant understand why this stored proc errors.
Procedure or function usp_ParentCatChildWeightUpdate has too many arguments specified.
/category.asp, line 572
This is the ASP it errors on the ,,adExecuteNoRecords line.
This is the SQL stored proc which runs fine from SQL query Analyser:
thanks
-Gus
Procedure or function usp_ParentCatChildWeightUpdate has too many arguments specified.
/category.asp, line 572
This is the ASP it errors on the ,,adExecuteNoRecords line.
Code:
with cmd
'response.write "<br>i got here i am a parent<br>"
'response.write "<br>" & request.form("cid") & " " & request.form("DefProdWeight") & "<br>"
.ActiveConnection = gConn
.CommandType = adCmdStoredProc
.CommandText = "usp_ParentCatChildWeightUpdate" 'update child subcat and products
.Parameters.Append .CreateParameter("@CategoryID", adInteger, adParamInput, 0)
.Parameters.Append .CreateParameter("@DefProdWeight", adInteger, adParamInput, 0)
.Parameters("@CategoryID") = request.form("cid")
.Parameters("@DefProdWeight") = request.form("DefProdWeight")
.Execute ,,adExecuteNoRecords
end with
This is the SQL stored proc which runs fine from SQL query Analyser:
Code:
SET QUOTED_IDENTIFIER ON
CREATE PROCEDURE [dbo].[usp_ParentCatChildWeightUpdate]
@CategoryID int,
@DefProdWeight int
AS
UPDATE [O]
SET
[O].Weight = @DefProdWeight
FROM
tblCategories AS [ParCat]
JOIN
tblCategories AS [SubCat]
ON
[ParCat].Category_ID = [SubCat].SubCategory_ID
JOIN
tblProducts AS [P]
ON
[SubCat].Category_ID = [P].Category_ID
JOIN
tblOptions AS [O]
ON
[P].Product_ID = [O].Product_ID
WHERE
([ParCat].Category_ID = @CategoryID AND [O].Verified_Weight = 0)
UPDATE [SubCat]
SET
[SubCat].DefaultWeight = @DefProdWeight
FROM
tblCategories AS [ParCat]
JOIN
tblCategories AS [SubCat]
ON
[ParCat].Category_ID = [SubCat].SubCategory_ID
WHERE
([ParCat].Category_ID = @CategoryID)
thanks
-Gus