16
I want to add multiple condition in single IF statement in SQL.
I am not good in SQL & referred some example, all are showing only one condition in IF.
Here is my procedure.
CREATE PROCEDURE [dbo].[AddApplicationUser]
(
@TenantId BIGINT,
@UserType TINYINT,
@UserName NVARCHAR(100),
@Password NVARCHAR(100)
)
AS
BEGIN
IF ((@TenantId IS NULL) AND (@UserType=0 OR @UserType=1) )
RAISERROR('The value for @TenantID should not be null', 15, 1) -- with log
Is this correct syntax in SQL for multiconditions in IF?