none
STUFF for SQL 2000?

Answers

  • David,

     

    You will need to create a user defined function that will handle this operation in SQL 2000.  Not ideal for performance, but you aren't going to get around it given that it is SQL 2000.  Arnie Rowland wrote up a good article that has a sample function in it that will show you exactly how to build it and use it:

     

    Create a Comma Delimited List from a Column in a Table

     

     

    Wednesday, October 08, 2008 7:58 PM
    Moderator

All replies

  • There is a post here that can help you 

    CREATE TABLE Names 
        names VARCHAR(32) 
    GO 
     
    SET NOCOUNT ON 
    INSERT Names SELECT 'firstname' 
    INSERT Names SELECT 'secondname' 
    INSERT Names SELECT 'thirdname' 
    INSERT Names SELECT 'fourthname' 
    GO 
     
    DECLARE @Names VARCHAR(1024) 
     
    SELECT 
        @Names = COALESCE(@Names + ',', '') + Names 
    FROM 
        Names 
     
    SELECT Names = @Names 
    GO 
    Wednesday, October 08, 2008 7:56 PM
  • David,

     

    You will need to create a user defined function that will handle this operation in SQL 2000.  Not ideal for performance, but you aren't going to get around it given that it is SQL 2000.  Arnie Rowland wrote up a good article that has a sample function in it that will show you exactly how to build it and use it:

     

    Create a Comma Delimited List from a Column in a Table

     

     

    Wednesday, October 08, 2008 7:58 PM
    Moderator