Link to home
Start Free TrialLog in
Avatar of jjexpert1
jjexpert1Flag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Ashish Patel
Ashish Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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