<p>Right now, I have a SQL Query like this one:</p>

<pre><code>SELECT X, Y FROM POINTS
</code></pre>

<p>It returns results like so:</p>

<pre><code>X    Y
----------
12   3
15   2
18   12
20   29
</code></pre>

<p>I'd like to return results all in one row, like this (suitable for using in an HTML &lt;AREA&gt; tag):</p>

<pre><code>XYLIST
----------
12,3,15,2,18,12,20,29
</code></pre>

<p>Is there a way to do this using just SQL?</p>

```
```
DECLARE @s VarChar(8000)
SET @s = ''

SELECT @s = @s + ',' + CAST(X AS VarChar) + ',' + CAST(Y AS VarChar) 
FROM POINTS

SELECT @s
```
```
Just get rid of the leading comma