Convert varchar to timestamp in SQL Server 2008 R2 -
there table timestamp
column in sql server 2008 r2. when add column table see values 0x00000000000007d1
. try put data it:
update test_time set date3= convert(timestamp, convert(datetime,'2002-08-20 14:00:00.000',120)) ogr_fid=1
but error
cannot update timestamp column
what's wrong here?
sql server's timestamp
datatype has nothing date , time!
it's binary representation of consecutive number - it's making sure row hasn't change since it's been read.
in never versions of sql server, it's being called rowversion
- since that's is. see msdn docs on rowversion:
is data type exposes automatically generated, unique binary numbers within database. rowversion used mechanism version-stamping table rows. rowversion data type just incrementing number , not preserve date or time. record date or time, use datetime2 data type.
so cannot convert string timestamp
in sql server.
Comments
Post a Comment