fn_CheckStringExistence
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@StrToCheck | nvarchar(max) | IN | |
@InStr | nvarchar(max) | IN |
Definition
Copy
create function dbo.fn_CheckStringExistence
(
@StrToCheck NVARCHAR(MAX),
@InStr NVARCHAR(MAX)
)
returns bit
as
begin
declare @IsExists bit = 0
select @IsExists = cast(case when count(1) = 0 then 0 else 1 end as bit)
from dbo.fn_GetTableFromStringWithSep(@StrToCheck, ',') Fn1
inner join dbo.fn_GetTableFromStringWithSep(@InStr, ',') Fn2
on Fn1.Val = Fn2.Val
return (@IsExists)
end