cast or convert a float to nvarchar?

前端 未结 7 1154
醉话见心
醉话见心 2021-02-03 22:02

I need to select from one column of datatype float and insert it in another column as nvarchar.

I tried to cast it: cast([Column_Name] as nvarchar(50))

7条回答
  •  [愿得一人]
    2021-02-03 22:57

    You can also do something:

    SELECT CAST(CAST(34512367.392 AS decimal(30,9)) AS NVARCHAR(100))
    

    Output: 34512367.392000000

提交回复
热议问题