Reputation: 32758
Here's what I have:
DECLARE Name VARCHAR(20)
DECLARE Pass INT
SELECT Name,
Pass,
FROM AdminTest
WHERE TestId = @TestId
But this selects and reports.
How can I have the values stored into the local variables?
Upvotes: 0
Views: 33
Reputation: 35780
It is incorrect declaration of variables. You should declare variables using @
. Do something like this:
DECLARE @Name VARCHAR(20)
DECLARE @Pass INT
SELECT @Name = Name,
@Pass = Pass,
FROM AdminTest
WHERE TestId = @TestId
Upvotes: 4