This code:
SomeField + ' <' + cast(count(AnotherField) as varchar(6)) + '>'
Generates the following result in the grid view:
Blah <Blah2>
How can I ensure the HTML entities show as their character equivalents? I’m surprised I wasn’t able to find a Google answer.
Thanks.
Here’s a larger snippet:
select
stuff((
select
', ' + SomeField + ' <' + cast(count(AnotherField) as varchar(6)) + '>'
from
SomeTable as SomeAbbrev
where
SomeField = SomeOutsideField
group by
SomeField
order by
SomeField asc
for xml path('')
),1,1,'') SomeFields
from
blablabla
inner join
blablabla
left join
blablabla
left join
blablabla
order by
SomeDateField asc
You can look at the technique used here or it may be simpler to bypass the XML technique all together and try something like the example below.
This example returns all tables with their columns as a comma delimited string.