Call scalar function from SubSonic

I have a SQL Server function that returns a scalar BIT value and takes one parameter. Following is the idea:

CREATE FUNCTION dbo.[fnTest] (@StringToTest VARCHAR(10)) 
RETURNS BIT 
AS
BEGIN 
    DECLARE @b BIT 
    IF @StringToTest = 'A' SET @b = 0 ELSE SET @b = 1
    RETURN (@b) 
END
GO

Being very new (days!) For SubSonic - what would you call it with SubSonic?

(I use a website with the base file "subsonic.abp" with an asterisk in it).

+3
source share
1 answer

Received!

Here's how in VB:

Return New SubSonic.InlineQuery().ExecuteScalar(Of Boolean)("SELECT dbo.[fnTest](@StringToTest)", StringToTest)

Thanks, hope this helps someone else

Thomas

+1
source

Source: https://habr.com/ru/post/1709636/


All Articles