Solved

Fake Table

Posted on 2011-09-27
2
170 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

708 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

18 Experts available now in Live!

Get 1:1 Help Now