@@DBTS

  • Here are the two relevant statements from Books Online:

    "Returns the value of the current timestamp data type for the current database." (in the definition)

    "@@DBTS returns the last-used timestamp value of the current database." (in the remarks)

    How can both of these be true? Because the timestamp for the database is NOT the current time. It's also not the timestamp to use next (that's indeterminate.) The timestamp for the database is the time to which the database is current.

    Think of the timestamp as the datecode on a product. It's not the current time, or the time when the next product will have been made, it's the time when the product you have in your hand was made.

    So when you select @@DBTS, you're asking the question "How current is the database?", or, more specifically, "when was the last time a timestamped record was inserted/updated?"

    So both answers are correct.

  • I think it's a case of interpretation.

    I think I get it now. Both answers are correct if we assume that the value of the most recent usage of the timestamp data type is preserved within the database and constantly updated each time a value is written or updated in 1 of it's tables.

    Now that's NEWS to me!

    And that's not all. Its

    ...guaranteed to be unique.

    This would ensure a sequential audit trail, but I never new it existed as such.

    I can picture a queue of columns waiting in line to get their timestamps.:-)

    Tom Garth
    Vertical Solutions[/url]

    "There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
  • This one tripped me up as well. Checking http://msdn.microsoft.com/en-us/library/ms187366.aspx it does say :

    "Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database."

    In the remarks section it says:

    "@@DBTS returns the last-used timestamp value of the current database".

    Shows that you need to read everything! 🙂

    Steve

  • http://msdn.microsoft.com/en-us/library/ms187366.aspx

    SQL Server 2008 Books Online (August 2009)

    @@DBTS (Transact-SQL)

    "Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database."

    [Is this not B???]

    If you read on, there is a statement about last used, but come on, it is buried in the remarks section...

    I don't know if these questions serve much of a purpose as many of them seem to be 'trick' questions and 'more than one' choice, where the choices aren't clear if any or all of them are correct (yes, I have seen questions where checking ALL the checkboxes was the right answer). I spent three years developing learning materials and someone needs to sit the people creating the questions down and inform them on how to create a useful question.

  • The timestamp associated to a database is updated everytime you insert/update/¿delete? a record with a timestamp field.

    So, the CURRENT TIMESTAMP = LAST USED TIMESTAMP.

    Thanks for the correction, i was surprised when i answered the question, and the system asked me: !You were wrong!

  • SQL Server 2005 Books Online

    @@DBTS (Transact-SQL)

    Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.

  • steveb. (9/23/2009)


    This question is badly written, .. B is the most correct answer

    Cudn't agree wif u more

    What you don't know won't hurt you but what you know will make you plan to know better
  • the statement "Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database." in 2005 BOL was a misprint - the words "data type" should not be there. This has of course been fixed in 2008 BOL, see http://msdn.microsoft.com/en-gb/library/ms187366.aspx

    What do all the people who said that that was the correct answer imagine that "value of the current timestam data type" means? DO they think data types have values, instead of values having types?

    The optioon which is semantic nonsense is clearly incorrect. WHy has the answer been modified to say it is corrrecxt? Becuase some people complained about the answer not matching the error in 3006 BOL, presumably because they did not ask themselves what the words in 2006 BOL could imaginably mean.

    Changing the answer when people are complaining that it's wrong and have good grounds for doing so is absolutely needed. Changeing it because a bunch of people are complaining because they did not bother to think it through was probably a mistake.

    Tom

Viewing 8 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic. Login to reply