Solved

Fake Table

Posted on 2011-09-27
2
171 Views
Last Modified: 2012-05-12
I have read only writes in SQLServer '08;
and was wondering if there wasn't a better way to do this:
WITH DUMB_TABLE(QUESTION, ANSWER)
AS
(

SELECT 1,2

UNION

SELECT 3,4

UNION

SELECT 5,6
)

SELECT * FROM DUMB_TABLE

Open in new window

0
Comment
Question by:JustinW
2 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 500 total points
ID: 36710391
There's no need to use a CTE for that.  You get the same result by just using your inner select statement like this.

Greg

SELECT 1 AS QUESTION, 2 AS ANSWER
UNION
SELECT 3,4
UNION
SELECT 5,6
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 36710527
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now