jjexpert1
asked on
SQL IF statement
I would like to create a stored procedure which pulls different data depending on the @Type that i provide.
Is there a way to use "IF" logic within an SQL statement?
Is there a way to use "IF" logic within an SQL statement?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or Try using Case @Type = 'somevalue' Then 'something' Else 'something' End
Sorry it should be like
Case When @Type = 'somevalue' Then 'something' Else 'something' End
Case When @Type = 'somevalue' Then 'something' Else 'something' End