March 1, 2007 at 11:48 am
Why this procedure does not work ?
I intended to make updates in two different tables with just one procedure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALTER PROCEDURE UpdateNonEbookOrders2
(@OrderID INT,
@ProductID INT,
@UserName VARCHAR(50),
@FirstName VARCHAR(50),
@LastName VARCHAR(150),
@CustomerEmail VARCHAR(50),
@NumOfItems INT,
@ShippingAddress VARCHAR(500),
@ShippingCity VARCHAR(50),
@ShippingCounty VARCHAR(50),
@ShippingZip VARCHAR(20),
@ShippingCountry VARCHAR(50),
@ShippingTelephone VARCHAR(50),
@DateCreated SMALLDATETIME,
@PaymentConfirmed BIT,
@Completed BIT,
@Canceled BIT,
@Comments VARCHAR(500),
@ProductName VARCHAR(100),
@IsEbook BIT,
@Quantity INT,
@Prepared BIT,
@DateSent SMALLDATETIME,
@Received BIT,
@UnitCost MONEY)
AS
UPDATE OrderDetail
SET ProductName = @ProductName, IsEbook = @IsEbook, Quantity = @Quantity,Prepared = @Prepared,
DateSent = @DateSent, Received = @Received, UnitCost = @UnitCost
WHERE OrderID = @OrderID AND ProductID = @ProductID
UPDATE Orders
SET UserName = @UserName, FirstName = @FirstName, LastName = @LastName, CustomerEmail = @CustomerEmail,
NumOfItems = @NumOfItems, ShippingAddress = @ShippingAddress, ShippingCity = @ShippingCity,
ShippingCounty = @ShippingCounty, ShippingZip = @ShippingZip, ShippingCountry = @ShippingCountry,
ShippingTelephone = @ShippingTelephone, DateCreated = @DateCreated, PaymentConfirmed = @PaymentConfirmed,
Completed = @Completed, Canceled = @Canceled, Comments = @Comments
WHERE OrderID = @OrderID
March 1, 2007 at 11:51 am
What's the error message?
March 1, 2007 at 3:07 pm
Hi Anders
I just found out that the procedure is fine. The error actually was in a method that was passing the value of a wrong variable.
Thank you, anyway.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply