Posted by Malc on 05/11/06 03:18
Can somebody please tell me whether the following syntax is supported
or whether it's a "feature" that will someday stop working. It works in
both SQL Server 2000 and 2005 at the moment.
declare @var varchar(1000)
set @var = ''
select @var = @var + colx from some_table where col1 = some_value
colx is a varchar or at least is cast to one as part of the select
statement. If the where clause would normally return more than one row,
all returned values for colx are concatenated into @var.
I've not seen this syntax before but that doesn't make it wrong ;-)
Malc.
Navigation:
[Reply to this message]
|