I got a question about these two queries.
The first one does work, the second one does not. I know I’m missing something, I can’t see it though!
SELECT Kod10
FROM Adminview
WHERE Kvartal = 1
AND Användarnamn = 'LOLGATAN13'
AND År = '2013'
And this is the stored procedure
ALTER PROCEDURE [dbo].[Checkinpvalue]
@Inmånad varchar(50),
@Användarnamn varchar(50),
@Kvartal int
AS
SELECT Kod10
FROM Adminview
WHERE Kvartal = @Kvartal
AND Användarnamn = @Användarnamn
AND År = @Inmånad
Used like this:
EXEC Checkinpvalue 1, 'LOLGATAN13', '2013'
Edit: The reason I’m asking this is because I don’t like using selects directly. I would prefer using them through a procedure.
Edit: Answered! 🙂
The order of your parameters is wrong?!