示例

 
declare @str varchar(14)
set @str='20080210182031'

select cast(left(@str,8) as datetime)+stuff(stuff(right(@str,6),3,0,':'),6,0,':')

输出结果

2008-02-10 18:20:31.000

相关文章:

  • 2022-01-07
  • 2021-12-22
  • 2021-12-12
  • 2021-11-28
  • 2021-12-12
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-11-17
  • 2021-09-29
  • 2021-12-10
相关资源
相似解决方案