Take the 2-minute tour ×

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!

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
    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! :)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The order of your parameters is wrong?!

EXEC Checkinpvalue '2013', 'LOLGATAN13', 1
share|improve this answer
Oh, haha. This happens when you dont got enough sleep. Thank you. –  saturn Jan 13 '13 at 20:59
Will mark as answer, thank you yet again. –  saturn Jan 13 '13 at 21:01
add comment

Your Answer


