Home Forums SQL Server 2008 T-SQL (SS2K8) Wildcard DB name in VIEW of Procedure - Possible? RE: Wildcard DB name in VIEW of Procedure - Possible?

  • I'm not using the special characters you listed, but look closely at the code below at how I am using FOR XML PATH to concatenate the values. Incorporate what you see there into your code and see if that helps.

    declare @TestData table(id int);

    with e1(n) as (select row_number() over (order by (select null)) from (values (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))dt(n))

    insert into @TestData

    select n from e1;

    select * from @TestData;

    -- Concatenate the data:

    select

    stuff((select ',' + cast(id as varchar)

    from @TestData

    order by id

    for xml path(''),TYPE).value('.','varchar(max)'),1,1,'');