i have field @message selected from
select @message = message from inserted
select @reqport = reqport from inserted
i want to check if this @message is between 1 to 40
maybe the message contain other word i want to check if it's numeric and if @message is a number from 1 to 40
and i want to add for the first one to check if @reqport is 1234 or 4567 or 7890 and the message between 1 to 40
how i can write this using if (
Microsoft SQL Server 2005Microsoft SQL Server 2008SQL
Last Comment
Qlemo
8/22/2022 - Mon
igordevelop
Hi,
IF @message > 1 and @message < 40
BEGIN
//SOME SQL
END
ELSE
//SOME SQL
same goes for @reqport
IF @reqport = 1234 OR @reqport = 4567 OR @reqport = 7890
BEGIN
//SOME SQL
END
ELSE
//SOME SQL
AFIF JABBADO
ASKER
i want to match the two restriction in the same time
IF @message > 1 and @message < 40
BEGIN
//SOME SQL
END
ELSE
//SOME SQL
same goes for @reqport
IF @reqport = 1234 OR @reqport = 4567 OR @reqport = 7890
BEGIN
//SOME SQL
END
ELSE
//SOME SQL