Datatype

  • what sql data type would fit these value? This is timestamp field in the ERP.

    2013-05-24-20.03.46.843480

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • tried datetime2(0) and datetime2(7). Didn't work.

  • 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))

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 4 posts - 1 through 3 (of 3 total)

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