I have a stored procedure in SQL Server 2008 that I want to store a GUID that I Select into a local variable for further use. I am trying it as below (and with several other variations), but am getting a syntax error near ‘@myvars’…
DECLARE @myvars uniqueidentifier;
SELECT ID
INTO @myvars
FROM Device
WHERE DeviceID=@DeviceID
Any help is appreciated. Thanks!
try:
quick test:
OUTPUT: