-- -- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below. -- -- This block of comments will not be included in -- the definition of the function. -- ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= CREATE FUNCTION NonNullAi ( -- Add the parameters for the function here @attributeName varchar(50) ) RETURNS INT AS BEGIN DECLARE @NonNullAi INT; -- Add the SELECT statement with parameter references here SELECT @NonNullAi = COUNT(value) FROM dbo.CorrelationAttributes WHERE (attribute = @attributeName) and value is not null and not value=''; RETURN @NonNullAi; END; GO