September 23, 2009 at 12:11 am
oops!! thought the checkboxes where radio buttons.
"Keep Trying"
September 23, 2009 at 1:30 am
ChiragNS (9/23/2009)
oops!! thought the checkboxes where radio buttons.
Same for me. Would have been better to add "select all that apply" to the question, like it is normally done.
September 23, 2009 at 1:58 am
Me too... never occurred to me I could choose multiple items.
September 23, 2009 at 2:28 am
In SQL 2008 Books online I find under @@DBTs:
Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
So I think it's strange that answer b is wrong.. don't think it's a good question if books online says different from your 'correct' answer.
Also in books online:
Examples
The following example returns the current timestamp from the AdventureWorks database.
Copy Code
USE AdventureWorks;
GO
SELECT @@DBTS
September 23, 2009 at 3:19 am
This question is badly written, .. B is the most correct answer
September 23, 2009 at 3:34 am
wim.buyens (9/23/2009)
In SQL 2008 Books online I find under @@DBTs:Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
So I think it's strange that answer b is wrong.. don't think it's a good question if books online says different from your 'correct' answer.
In SQL 2005 books online is mentioned under remarks:
@@DBTS returns the last-used timestamp value of the current database. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
September 23, 2009 at 3:43 am
I agree - the question should have said click all that apply and then we might have thought "I wonder if there is more than the obvious answer from BOL".
September 23, 2009 at 4:03 am
Me too! Didn't spot the tick boxes until too late. Didn't see anything that matched the 2nd answer either. Not a happy bunny !!! :crying: More tea needed.
How do I apply for a refund ...
September 23, 2009 at 4:23 am
ChiragNS (9/23/2009)
oops!! thought the checkboxes where radio buttons.
And me. I even looked up the answer in BOL, as I'd never heard of the function, and so got the same only-partly-correct answer as it gives there.
At least the QotD has achieved it's purpose of teaching me something (though I suspect I'll quickly forget it again!)
September 23, 2009 at 6:21 am
Mark_Pratt (9/23/2009)
How do I apply for a refund ...
Well, if you can convince the coach of Oregon that your wrong answer was associated with the Ducks loss at Boise State, you might get something...
http://thequad.blogs.nytimes.com/2009/09/21/check-please-coach-kelly/
September 23, 2009 at 7:57 am
I have edited the question. I'll award back points to this time now.
September 23, 2009 at 8:24 am
I don't understand how it could return both the current and the last timestamp used. According to MSDN, @@DBTS returns the last-used timestamp value of the current database. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
This means that it's the last timestamp used -- not the current time stamp.
http://msdn.microsoft.com/en-us/library/ms187366.aspx
I even tested it and if it was the current time stamp, it would change every time you ran the select command. It stays the same until a row is updated or inserted that contains a timestamp column.
September 23, 2009 at 9:35 am
Steve is correct to award points. While testing the script indicates only answer #3 is correct. it's possible to find Microsoft documentation supporting answer 2 and also supporting answer 3.
The confusion is easy to understand. I too had never heard of @@DBTS, so I ran the script. It obviously wasn't returning the data type.
Then I looked it up in BOL. Both 2000 and 2005 BOL are absolutely clear in stating
Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
.
It is equally clear in the Remarks on the same page that
@@DBTS returns the last-used timestamp value of the current database. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
and in the Example area -
The following example returns the current timestamp from the AdventureWorks database.
The URL to the MSDN Library page leads to supporting answer 3 as well.
Thanks Microsoft - :hehe:
September 23, 2009 at 10:15 am
I think it's a case of interpretation.
It first states that it:
Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.
Then in the remarks:
@@DBTS returns the last-used timestamp value of the current database. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
If you think of the current timestamp as the last one currently in use, it makes sense. I agree it could have been phrased much better, but I think that may have been what they were thinking.
You could then use this as a way of checking that the timestamp column in a given table was updating properly without actually looking at the table itself.
Viewing 15 posts - 1 through 15 (of 22 total)
You must be logged in to reply to this topic. Login to reply