Reputation: 424
In the below sql server function, where would i add a if/else statement if I need to compare the @string value and then return the result?
ALTER FUNCTION [AdminUsers] (@string [nvarchar](max), @slat [nvarchar](max))
RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
AS EXTERNAL NAME [EnDec_Sql].[EnDec].[fn_Decrypt]
Upvotes: 0
Views: 3046
Reputation: 1604
You can't. You're calling a CLR function directly. When you call CLR Functions ALL your t-Sql function body can do is reference the CLR assembly code. You cannot mix the two.
Create a NEW function that calls this one then has the logic you require.
Upvotes: 1