Using Sql Server 2012. I have a stored procedure, and part of it checks to see if the username is in the table. If so, return 1, if not, return 2. This is my code:
IF EXISTS (SELECT * FROM tblGLUserAccess WHERE GLUserName ='xxxxxxxx') 1 else 2
However, I keep getting the following error:
Incorrect syntax near '1'.
Is this possible with IF EXIST?
Hi,
Michael
sql sql-server sql-server-2012 stored-procedures if-statement
Michael
source share