-->

Return a CSV of the affected records without using OUTPUT

Post a Comment

set
nocount
on

declare @Tab table ( id int
identity
, i int
,j date
)

insert
into @Tab select 1,
'2008-01-01'

insert
into @Tab select 1,
'2008-01-02'

insert
into @Tab select 1,
'2008-01-03'

insert
into @Tab select 2,
'2008-01-04'

insert
into @Tab select 2,
'2008-01-15'

insert
into @Tab select 1,
'2008-01-21'


 

declare @res varchar(max)


 

update @Tab

set @res =
COALESCE(@res+',',
'')+CAST(id as
varchar
),

j =
SYSDATETIME()

where i = 1


 

select
*
from @Tab

select @res


 

Related Posts

There is no other posts in this category.

Post a Comment

Subscribe Our Newsletter