How do I convert an arbitrary list of strings to a SQL rowset?

Posted by Jim Kiley on Stack Overflow See other posts from Stack Overflow or by Jim Kiley
Published on 2010-04-12T15:21:02Z Indexed on 2010/04/12 15:23 UTC
Read the original article Hit count: 199

Filed under:
|

I have a simple list of strings, which may be of arbitrary length. I'd like to be able to use this list of strings as I would use a rowset. The app in question is running against SQL Server.

To be clearer, if I do SELECT 'foo', 'bar', 'baz' I get 'foo', 'bar', and 'baz' as fields in a single row. I'd like to see each one of them as a separate row.

Is there a SQL (or SQLServer-specific) function or technique that I'm missing, or am I going to have to resort to writing a function in an external scripting language?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server