General information
Title:
Syntax for Stored Procedure
Hello All !
I’m wondering may I use CASE or IF statement in Where clause when I’m writing stored procedure ?
For example stored procedure looks like this
CREATE PROCEDURE dbo.usp_test
@corpname varchar(30)
@corpdba varchar(30)
AS select corp.corp_name from corp
where corp.corp_name like ‘%’+@corpname+’%’ or corp.corp_dba like ‘%’+@ corpdba +’%’
Is there any way to check inside the procedure if any of parameters is empty ?
Thanks in advance
Mariam
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only