July 14, 2014 at 10:22 am
what sql data type would fit these value? This is timestamp field in the ERP.
2013-05-24-20.03.46.843480
July 14, 2014 at 10:26 am
DateTime2 probably
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
July 14, 2014 at 10:42 am
tried datetime2(0) and datetime2(7). Didn't work.
July 14, 2014 at 11:12 am
You need to format the string.
SELECT CAST( STUFF( STUFF( STUFF( '2013-05-24-20.03.46.843480', 11, 1, 'T'), 14, 1, ':'), 17, 1, ':') AS datetime2(7))
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply