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 123»»»

SQL 2K5 - Table-Valued Parameters Expand / Collapse
Author
Message
Posted Friday, January 15, 2010 12:10 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, June 23, 2014 6:03 AM
Points: 1,154, Visits: 866
Comments posted to this topic are about the item SQL 2K5 - Table-Valued Parameters
Post #848102
Posted Friday, January 15, 2010 7:02 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 12:58 PM
Points: 2,561, Visits: 3,842
I'm kind of confused by the question. I thought it was discussing table variables. Maybe it's too early in the day, yet.
Post #848235
Posted Friday, January 15, 2010 7:07 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 3:43 PM
Points: 39,866, Visits: 36,206
Table-valued parameters - http://msdn.microsoft.com/en-us/library/bb510489.aspx


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #848240
Posted Friday, January 15, 2010 7:16 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 10:57 AM
Points: 3,323, Visits: 1,988
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!
Post #848246
Posted Friday, January 15, 2010 7:28 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 2:13 PM
Points: 1,889, Visits: 2,036
yep it is too early in the day, I've got to stop answering these before I've had some caffiene
Post #848260
Posted Friday, January 15, 2010 10:12 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 28, 2014 4:53 AM
Points: 1,105, Visits: 301
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!
Post #848425
Posted Friday, January 15, 2010 10:16 AM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 8:22 PM
Points: 20,676, Visits: 32,264
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)
Post #848428
Posted Friday, January 15, 2010 10:21 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 28, 2014 4:53 AM
Points: 1,105, Visits: 301
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!
Post #848431
Posted Friday, January 15, 2010 10:23 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 28, 2014 4:53 AM
Points: 1,105, Visits: 301
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!
Post #848432
Posted Friday, January 15, 2010 10:30 AM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 8:22 PM
Points: 20,676, Visits: 32,264
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)
Post #848438
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse