conrad2010
asked on
T-SQL select output to string
what is the quickest way to have the resultset (multimple records, one field) of a SELECT statement be formatted into one string?
SELECT
name
FROM
tblCity
WHERE
state = 'CA'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
another way:
SELECT
name+',' AS cities
FROM
tblCity
WHERE
state = 'CA'
FOR XML PATH ('')
I'm guess, you want the select multiple fields from a conditional select statement and have the returned result 1 string but your code snippet is confusing.
Let us know.