Call me lazy... BUT, Is there any way to make this one assignment statement:
Sure, I could just type out the extra four lines, but it would be so nice to do in all at once!
Thanks!
-MK
Code:
DECLARE @Variable1 int
DECLARE @Variable2 int
DECLARE @Criteria int
SET @Criteria = 123
SELECT @Variable1 = (
SELECT Field1
FROM Table
WHERE SearchField = @Criteria )
SELECT @Variable2 = (
SELECT Field2
FROM Table
WHERE SearchField = @Criteria )
Sure, I could just type out the extra four lines, but it would be so nice to do in all at once!
Thanks!
-MK