September 29, 2008 at 12:46 pm
I have a colume and with that have a timestamp and when do a select it give me
0x0000000000000BB9
0x0000000000000BBA
0x00000000000007D4
0x00000000000007D5
I need to change timestamp (rowversion ) column to a datetime that is readable ..
I cant came up with a code ..need help
September 29, 2008 at 1:49 pm
timestamp, despite it's name, has nothing to do with time. It's a binary value unique within the DB that changes whenever the row is changed. It's more a row version than anything else
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 29, 2008 at 1:49 pm
Did you try using the CAST function?
CAST(0x0000000000000BB9 as DATETIME)
CAST(0x0000000000000BBA as DATETIME)
CAST(0x00000000000007D4 as DATETIME)
CAST(0x00000000000007D5 as DATETIME)
HTH
Fraggle
September 29, 2008 at 2:17 pm
Fraggle (9/29/2008)
Did you try using the CAST function?
It may convert, but the conversion will be completely meaningless. timestamp is not in anyway related to a time.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 29, 2008 at 2:29 pm
You are correct Gail. I just saw it was in binary format and automatically figured the cast function would work. Didn't even test it. After testing it, the cast does give you data and puts it in datetime format, but as you said, it is bad data and useless.
Fraggle.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy