EchoAlertcom
IS-IT--Management
Hello,
I need help with variables. I have copied some sql below. What I need to do is. Make the variable @HelpMe = the value from oi.catalogid and then use the variable in the insert statement below. Thank you for all your help.
Sincerely,
Steve Funk
I need help with variables. I have copied some sql below. What I need to do is. Make the variable @HelpMe = the value from oi.catalogid and then use the variable in the insert statement below. Thank you for all your help.
Code:
SELECT oi.catalogid,
oi.orderid,
o.orderid
FROM shopping400.dbo.oitems oi INNER JOIN shopping400.dbo.orders o
ON oi.orderid = o.orderid
WHERE oi.orderid = (Select max(shopping400.dbo.oitems.orderid) from shopping400.dbo.oitems)
DECLARE @HelpMe int(4)
SET @HelpMe = oi.catalogid
INSERT INTO EchoAlert.dbo.A_ClientMaster(InitialPlanID) VALUES (@HelpMe)
GO
Sincerely,
Steve Funk