i have a function (not a stored procedure) in DB which returns 0/1. How can I retrieve this value in C#?
ALTER function dbo.code
(@_code INT)
RETURNS INT
AS
BEGIN
DECLARE @result bt
IF EXISTS (
SELECT fld_code
FROM client.TBL_Table(NOLOCK)
WHERE code = @_code
AND used = 0
)
SET @result = 1
ELSE
SET @result = 0
RETURN @result
END