Are there Table Literals in Transact-SQL?

Viewed 6099

According to http://www.storytotell.org/blog/2008/11/14/literal-tables-and-updates-with-joins-in-sql.html

the following is valid:

SELECT * 
        FROM VALUES 
        ('Lisp', 50, true), 
        ('Scheme', 30, true), 
        ('Clojure', 1, true) 
        AS languages (name, age, lispy)

But it doesn't appear to work.

The best i can get is

With languages (name, age, lispy) as
(
    select 'Lisp', 50, 'true' union all 
    select 'Scheme', 30, 'true' union all 
    select 'Clojure', 1, 'true'
)
select * from languages

which uses a common table expression and is not quite as neat.

Is there anything like a table literal in t-sql?

2 Answers
Related