Setting two scalar variables in one SELECT statement?
DECLARE @a int;
DECLARE @b int;
SELECT @a = StartNum, @b = EndNum
FROM Users
WHERE UserId = '1223'
Do it like this:
Declare @a int;
Declare @b int;
SELECT @a=StartNum,@b=EndNum FROM Users Where UserId = '1223'
PRINT @a
PRINT @b