Blue Ridge Software LLC
  Encryption
Services
  Webmaster
Services
  Programming   Software   About Us

Program Snippets

  SQL 2000 - Comma-delimited list from sql (Add To Favorites)
CREATE FUNCTION dbo.MyCompaniesList_A()
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @Str VARCHAR(8000)
SET @Str = ''
SELECT @Str = @Str + CASE WHEN LEN(@Str) > 0 THEN ',' ELSE '' END + cast(CompanyID as varchar)
FROM Companies
WHERE Companyname2 LIKE 'A%'
ORDER BY Companyname2 ASC
RETURN @Str
END

DECLARE @Str VARCHAR(8000)
SET @Str = dbo.MyCompaniesList_A()
PRINT @Str

drop function.dbo.MyCompaniesList_A
© 2013- Blue Ridge Software LLC