当前位置:网站首页>Sqlserver string type converted to decimal or integer type
Sqlserver string type converted to decimal or integer type
2022-06-30 21:21:00 【※※ Bingxin ※※】
stay SQL Server in , There are three ways to convert a string value to a numeric value .
1. Use cast() Method .
select cast('6.0' as decimal(6, 2)); -- 6.00
2. Use convert() Method .
select convert(decimal(6, 2), '100'); -- 100.00
3. Use and value 0 The method of addition .
select '233' + 0; -- 233
The above three methods should pay special attention to the value of the converted type when converting the type , Because there may be various problems of forced conversion failure , For example, the number of decimal places / Error reporting caused by format mismatch .
边栏推荐
- Clickhouse Native Monitoring item, System table Description
- What about degradation of text generation model? Simctg tells you the answer
- 在手机炒股开户安全吗?
- [grade evaluator] how to register a grade evaluator? How many passes?
- 数字货币:影响深远的创新
- ceshi deces
- 科研中遇到迷茫困惑如何向前一步?如何在科研中发挥女性优势?
- 三个火枪手
- Go build server Foundation
- Adobe Photoshop (PS) - script development - remove file bloated script
猜你喜欢

时空数据挖掘:综述
![[untitled]](/img/42/47a8c8faaed33a1d9e864cb2ef7b72.png)
[untitled]

qiao-npms:搜索npm包

Apply for vector bus protocol color picture wallpaper hanging picture, very good!

开源实习经验分享:openEuler软件包加固测试

ArcGIS construction and release of simple road network data service and rest call test

go搭建服务器基础

Reading notes of Clickhouse principle analysis and Application Practice (3)

Dm8: generate DM AWR Report

How to move forward when facing confusion in scientific research? How to give full play to women's advantages in scientific research?
随机推荐
时空数据挖掘:综述
科研中遇到迷茫困惑如何向前一步?如何在科研中发挥女性优势?
申请Vector 总线协议彩图壁纸挂画,非常棒哦!
qiao-npms:搜索npm包
[grade evaluator] how to register a grade evaluator? How many passes?
等级测评是什么意思?工作流程包含哪些?
报错:Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
Radar data processing technology
Oprator-1 first acquaintance with oprator
网络营销之四大误解
升级kube出现unknown flag: --network-plugin
stacking集成模型预测回归问题
Adobe-Photoshop(PS)-脚本开发-去除文件臃肿脚本
Metauniverse may become a new direction of Internet development
Ssh server configuration file parameter permitrootlogin introduction
12345
Software engineering UML drawing
文本生成模型退化怎么办?SimCTG 告诉你答案
How to move forward when facing confusion in scientific research? How to give full play to women's advantages in scientific research?
Test medal 1234