Hi everyone
I would like to know how to declare a variable
Set a value from a database table to that variable
And Then IF that variable = a value
Then to execute an Update statement
The error message i get when executing the stored procedure is as follows:
The multi-part identifier "dbo.OrdersCheckStockAvailable.WarehouseTypeID" could not be bound.
The example of the code i have attempted is as below.
DECLARE @WID varchar(10)
SET @WID =dbo.OrdersCheckStockAvailable.WarehouseTypeID
IF @WID = 'WT1'
BEGIN
UPDATE dbo.OrderParams SET dbo.OrderParams.WarehouseTypeID='WT2' WHERE (dbo.OrderParams.TempOrderNo)=@TON;
END
CAN ANYONE PLEASE HELP ME WITH THIS ONE.
I would like to know how to declare a variable
Set a value from a database table to that variable
And Then IF that variable = a value
Then to execute an Update statement
The error message i get when executing the stored procedure is as follows:
The multi-part identifier "dbo.OrdersCheckStockAvailable.WarehouseTypeID" could not be bound.
The example of the code i have attempted is as below.
DECLARE @WID varchar(10)
SET @WID =dbo.OrdersCheckStockAvailable.WarehouseTypeID
IF @WID = 'WT1'
BEGIN
UPDATE dbo.OrderParams SET dbo.OrderParams.WarehouseTypeID='WT2' WHERE (dbo.OrderParams.TempOrderNo)=@TON;
END
CAN ANYONE PLEASE HELP ME WITH THIS ONE.
