Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Unisci i personaggi usando SET BASED APPROACH (Sql Server 2005)

Ho solo bisogno di ottenere il bit PATH XML corretto...

CREATE TABLE #foo (bar char(1))

INSERT #foo SELECT 'a' UNION ALL SELECT 'b' UNION ALL SELECT 'c'
GO

SELECT
    buzz
FROM
    (
    SELECT 
        CAST(bar AS varchar(8000))
    FROM 
        #foo
    FOR XML PATH ('')
    ) fizz(buzz)

DROP TABLE #foo