Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234»»

SELECT * usage Expand / Collapse
Author
Message
Posted Thursday, May 10, 2012 9:22 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 4:58 AM
Points: 2,467, Visits: 6,437
Yet another reason never to do a SELECT *.

Great question, Wayne! And although I found the reference that Koen supplied, I still got the answer wrong. Anyhow, I learned something. That alone is worth it.

And no, I didn't think that the question was badly worded.


--------------------------------------------------------------------------
A little knowledge is a dangerous thing (Alexander Pope)

In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)
Post #1297970
Posted Thursday, May 10, 2012 9:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Monday, August 25, 2014 6:32 PM
Points: 11,194, Visits: 11,140
WayneS (5/10/2012)
I tried (and sent this QotD to several folks to get their opinions) to make this a good QotD without this controversy.

Oops! I did see your mail, Wayne, but I was away from home at the time, and it slipped through the net. Sorry




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1297976
Posted Thursday, May 10, 2012 9:59 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 9:36 AM
Points: 21,644, Visits: 15,314
Good question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1298007
Posted Thursday, May 10, 2012 11:55 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, August 22, 2014 8:50 AM
Points: 4,425, Visits: 3,417
Stewart "Arturius" Campbell (5/10/2012)
Interesting question, Wayne
Learned something new here.

+1 - foprced me to search MSDN.
Post #1298074
Posted Thursday, May 10, 2012 12:01 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 8:33 AM
Points: 13,622, Visits: 10,512
sknox (5/10/2012)

Not a good excuse, but a very good reason. I remember reading somewhere that the best way to read multiple-choice questions is to skim the question, read the answers carefully, and then go back and read the question very carefully, with the answers in mind. This reinforces the context of the question, and focuses you on picking out bits that disqualify the wrong answers.

I have no idea if that's true, but it seems to work for me.


I use the technique in the Microsoft certification exams and it works pretty well




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1298079
Posted Friday, May 11, 2012 11:02 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:20 AM
Points: 2,933, Visits: 2,952
Extra question!
I missed it, but I appreciate it much.
Learned something new.
Thanks
IgorMi




Igor Micev,
SQL Server developer at Seavus
www.seavus.com
Post #1298774
Posted Friday, May 11, 2012 12:59 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 10:12 AM
Points: 8,721, Visits: 9,270
WayneS (5/10/2012)
So phase 2 of my learning is: how could I have done it better?

Wayne, the question itself is clear, it's the wording of the answer options that makes it a bit unclear.

In the question, you say
not return a column as an individual column in the result set
so the meaning of "return" is clearly qualified.

In four of the five options provided for the answer you use "return" unqualified, which risks that readers will forget the qualification; in the other option you don't use "return" at all, and I think this is best. The other answers could easily be changed to avoid using "return" as well:
First option: just the single word "Never" would do fine.
Second option: could read "When the table contains sparse columns for which no selected row contains a non-null value".
Third option: is ok as it stands.
Fourth option: could read "When the table contains sparse columns and a sparse column set and some of the sparse columns have non-null values in none of the rows selected".
Fifth option: could read "Whenever the table contains sparse columns and a sparse column set".

I think this would have been a good deal clearer, because when one looks at the answers and forgets the qualification of return in the question a different one appears to be correct - assuming that "a null sparse column" has the meaning of the phrase I used above about no no-nulls in that column in the selected rows. Without the repeated use of unqualified "return" pushing one towards the ordinary meaning of return there is no reaon to forget the qualification in the question.

Incidentally, I wouldn't worry too much about a couple of us saying it could be clearer; that can be said of many qa QotD and many an article too (inluding mine, for sure).


Tom
Post #1298882
Posted Sunday, May 13, 2012 11:29 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 12:27 AM
Points: 1,101, Visits: 1,364
Great question. Learn something new today...

Thanks
Post #1299352
Posted Thursday, May 17, 2012 8:09 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:45 PM
Points: 1,589, Visits: 253
Good question. Thanks for submitting.

http://brittcluff.blogspot.com/
Post #1302240
Posted Monday, May 21, 2012 3:24 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 5:25 AM
Points: 939, Visits: 885
that was nice, thank you

as per msdn :
Caution
Adding a column set changes the behavior of SELECT * queries. The query will return the column set as an XML column and not return the individual sparse columns. Schema designers and software developers must be careful not to break existing applications.


Iulian
Post #1303234
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse