|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:06 AM
Points: 1,134,
Visits: 818
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 7:16 AM
Points: 2,030,
Visits: 2,869
|
|
I'm kind of confused by the question. I thought it was discussing table variables. Maybe it's too early in the day, yet.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:08 PM
Points: 38,099,
Visits: 30,392
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 11:48 AM
Points: 2,602,
Visits: 1,553
|
|
| This is where my lack of experience with SQL 2008 bites me again. I too thought the question was referencing table variables. Good question, I learned something new!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 10:13 AM
Points: 1,573,
Visits: 1,732
|
|
yep it is too early in the day, I've got to stop answering these before I've had some caffiene
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 4:08 AM
Points: 941,
Visits: 239
|
|
To my mind, this question could/should have been moderated and edited to make it clearer.
Even though I would have got it wrong had it actually been asking what I thought it was, the fact that it was pretty badly written added an additional, unnecessary level of misdirection that just gets in the way.
The 'correct' answer does not in itself actually answer the question - I have no more idea now than I had ten minutes ago whether table VARIABLES in SQL2K5 can be set to NULL, even though I did actually know that you can't have table parameters in SQL 2K5 (as they would have solved a lot of my problems last year). I skimmed the answers, thought 'I know SQL2K5 can have table variables' (I admit - misreading on my part but I assumed that if it was a 'trick' question then that answer would refer to all parts of the question equally, given that there's only single word answers for the other options) and gave some thought to whether a table VARIABLE can be set to NULL or not. I made my choice, got it wrong, but didn't actually find out the answer.
So can table variables be set to NULL? Perhaps this could be added to the explanation...
------------------------------- Oh no!
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 8:51 PM
Points: 21,832,
Visits: 27,861
|
|
Kevin Gill (1/15/2010) To my mind, this question could/should have been moderated and edited to make it clearer.
Even though I would have got it wrong had it actually been asking what I thought it was, the fact that it was pretty badly written added an additional, unnecessary level of misdirection that just gets in the way.
The 'correct' answer does not in itself actually answer the question - I have no more idea now than I had ten minutes ago whether table VARIABLES in SQL2K5 can be set to NULL, even though I did actually know that you can't have table parameters in SQL 2K5 (as they would have solved a lot of my problems last year). I skimmed the answers, thought 'I know SQL2K5 can have table variables' (I admit - misreading on my part but I assumed that if it was a 'trick' question then that answer would refer to all parts of the question equally, given that there's only single word answers for the other options) and gave some thought to whether a table VARIABLE can be set to NULL or not. I made my choice, got it wrong, but didn't actually find out the answer.
So can table variables be set to NULL? Perhaps this could be added to the explanation...
declare @TestTab table (TableID int, TableData varchar(32)); set @TestTab = null;
Result:
Msg 137, Level 15, State 1, Line 2 Must declare the scalar variable "@TestTab".
 Lynn Pettis
For better assistance in answering your questions, click here For tips to get better help with Performance Problems, click here For Running Totals and its variations, click here or when working with partitioned tables For more about Tally Tables, click here For more about Cross Tabs and Pivots, click here and here Managing Transaction Logs
SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 4:08 AM
Points: 941,
Visits: 239
|
|
In fact, I'll go further (and you can't stop me ;o))
Whenever I miss the intended point of one of these questions, it's usually because I've not paid attention to the title, or because I've formulated my opinion as to the correct answer based on the version that appears in the daily email. The daily email of course does not include the title, or the answers.
Maybe if (as a minimum) the title of the question were included in the mail, I'd be more likely to know what subtleties to be looking for when I came to the site to answer, rather than just clicking the answer I'd already decided on and then wishing to express my opinions on the same when I believe the question is too much of a 'trick'.*
Anyway I'm done. Like I say, I'm not bothered that I got it wrong, just that it was hard for the wrong reasons.
* A trick question, to clarify my meaning is any question where there are a set of obvious answers (e.g. Yes/No) where the actual answer is none of those, and is a reference to some other subtlety involved in the process - one where you have to read the title and all the answers to know what it's actually asking...
------------------------------- Oh no!
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 4:08 AM
Points: 941,
Visits: 239
|
|
Lynn Pettis (1/15/2010)declare @TestTab table (TableID int, TableData varchar(32)); set @TestTab = null;
Result: [quote] Msg 137, Level 15, State 1, Line 2 Must declare the scalar variable "@TestTab". Cheers - I could have just tested it but I was too busy writing... And I would have got it right, had it been asking what I believed it to be asking
------------------------------- Oh no!
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 8:51 PM
Points: 21,832,
Visits: 27,861
|
|
Kevin Gill (1/15/2010) In fact, I'll go further (and you can't stop me ;o))
Whenever I miss the intended point of one of these questions, it's usually because I've not paid attention to the title, or because I've formulated my opinion as to the correct answer based on the version that appears in the daily email. The daily email of course does not include the title, or the answers.
Maybe if (as a minimum) the title of the question were included in the mail, I'd be more likely to know what subtleties to be looking for when I came to the site to answer, rather than just clicking the answer I'd already decided on and then wishing to express my opinions on the same when I believe the question is too much of a 'trick'.*
Anyway I'm done. Like I say, I'm not bothered that I got it wrong, just that it was hard for the wrong reasons.
* A trick question, to clarify my meaning is any question where there are a set of obvious answers (e.g. Yes/No) where the actual answer is none of those, and is a reference to some other subtlety involved in the process - one where you have to read the title and all the answers to know what it's actually asking...
When taking a test, particularly a multiple choice (multiple guess, if you prefer) don't you read the entire question and the answers before actually answering the question?
 Lynn Pettis
For better assistance in answering your questions, click here For tips to get better help with Performance Problems, click here For Running Totals and its variations, click here or when working with partitioned tables For more about Tally Tables, click here For more about Cross Tabs and Pivots, click here and here Managing Transaction Logs
SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
|
|
|
|