日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

【SQL SERVER】Convert Float to Varchar

系統 2565 0

Today,my customer asked me to import data to the database(SQL Server 2008 r2).

One of the columns whose type is varchar in the database,however unknow type in excel tab,records the code information.

when I imported the data from the excel to the database,I found that all the code details stored in the database changed to the type like '1.***xe**'.

After a small amount of trial,I found that we must Convert float to decimal before convert to varchar.

View Code
        
          1
        
        
          Select
        
        
          SUBSTRING
        
        (
        
          cast
        
         (
        
          Convert
        
        (
        
          decimal
        
        (
        
          20
        
        ,
        
          8
        
        ),a.Code) 
        
          as
        
        
          varchar
        
        (
        
          20
        
        )),
        
          1
        
        ,
        
          2
        
        ) 
        
          from
        
         a
      

?

【SQL SERVER】Convert Float to Varchar


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 江口县| 隆子县| 边坝县| 磐安县| 凉山| 鄂托克旗| 长岭县| 南城县| 黄陵县| 松滋市| 灯塔市| 增城市| 丁青县| 岢岚县| 乐安县| 和政县| 突泉县| 麻城市| 顺昌县| 金川县| 滦南县| 渭南市| 葫芦岛市| 新源县| 高唐县| 财经| 玛纳斯县| 宁乡县| 靖远县| 临夏县| 岗巴县| 民丰县| 阳高县| 方城县| 大渡口区| 简阳市| 通江县| 无棣县| 上杭县| 周口市| 鄂托克旗|