0

I'm currently trying to run the following query in SQL CE:

select column_name from information_schema.columns where table_name=[tablename]

This query, as expected, returns a set of columns which belong to the specified table. The returned data looks like this:

column1
column2
column3
column4

However, for this particular scenario, it is very important that the results are returned as a single string in a single field.

My desired output is:

column1,column2,column3,column4 etc...

How can I achieve this in SQL CE?

Mike Baxter
  • 6,868
  • 17
  • 67
  • 115
  • possible duplicate of [Combine multiple results in a subquery into a single comma-separated value](http://stackoverflow.com/questions/111341/combine-multiple-results-in-a-subquery-into-a-single-comma-separated-value) – lc. Mar 08 '13 at 12:34
  • 1
    @lc. does that solution work in CE? – Aaron Bertrand Mar 08 '13 at 12:39
  • @Ic. Please read both questions before claiming a duplicate. The link you posted is a SQL server question, this question is a SQL compact question. – Mike Baxter Mar 08 '13 at 12:39
  • Similar http://stackoverflow.com/questions/6830905/how-can-i-get-individual-results-in-sql-server-ce – www Mar 08 '13 at 12:56
  • @WawrzyniecSz. Again, please read both questions before linking a similar/duplicate question. The questions are completely different. – Mike Baxter Mar 08 '13 at 12:59

0 Answers0