I'm extending a stored procedure and I have to make some code that checks if a row contains some of the following then the SP will stop at the first stip which is this one. The SP contains of 6 steps and this is the first one. Which is used as a controller to see if the row contains some if these. If it's doesent then it should continue to the next step. If it does cointain some of the following then it should leave a notice and not contiune to the next step.
if @action = (select action from dbo.table where action like 'something-%')
if @action = (select action from dbo.table where action like 'something-else%')
if @action = (select action from dbo.table where action like 'something-new%')
if @action = (select action from dbo.table where action like 'something-old%')
if @action = (select action from dbo.table where action like 'something-cool%')
I have the first part need help with the second.
Cheers
if...else if. UsingCASEmight be better