In MySQL I could execute the following:
SELECT "spam" AS "foo", "eggs" AS "bar" LIMIT 1;
…which would return 1 row with 2 columns (“foo” and “bar) and 2 values (“spam” and “eggs”).
Is it possible to do this with TSQL in SQL Server?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do any of these:
Since you’re building a hard-coded set of values you don’t need a limiting clause. Just FYI, the equivalent in T-SQL is
TOP.