March 26, 2007 at 11:59 am
This statement works with SS2000 on my development PC,
but not on my production server as of today.
Select convert(datetime,@@dbts)
I get the following error message:
Syntax error converting datetime from binary/varbinary string.
Any suggestions?
March 26, 2007 at 12:20 pm
@@dbts is not a datetime. It is only a unique number generated by sql server.
Check out GetDate() for the current_timestamp
March 26, 2007 at 12:35 pm
I understand @@dbts returns a timestamp. Up until today, I could run the statement (and I can still run it on a couple other SS2000 instances on other machines).
Further investigation shows that I only cannot run it in query analyzer for one of the databases - the others work.
March 26, 2007 at 12:40 pm
Must have gone out of range of the datetime datatype... or a date setting has changed (but I'd go with the datetime limit).
And just to make sure we are on the same page :
@@DBTS returns the current database's last-used timestamp value. A new timestamp value is generated when a row with a timestamp column is inserted or updated.
@@DBTS is not a date in any way.
March 26, 2007 at 12:52 pm
Thanks for the info Ninja's_RGR'us
I believe you are correct that it is a datetime limit - thus it works in other databases (and instances).
March 26, 2007 at 10:58 pm
An equivalent to GETDATE() is
CURRENT_TIMESTAMP
N 56°04'39.16"
E 12°55'05.25"
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply