/****** Objeto: UserDefinedFunction [dbo].[TableDistinctAi] Fecha de la secuencia de comandos: 07/06/2011 10:14:48 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= CREATE FUNCTION TableDistinctAi ( @attributeName VARCHAR(50) ) RETURNS TABLE AS RETURN ( -- Add the SELECT statement with parameter references here SELECT COUNT(DISTINCT value) AS TableDistinctAi FROM dbo.CorrelationAttributes WHERE (attribute = @attributeName) AND attribute<>'' AND attribute IS NOT NULL ) GO