sql server 字符类型转换有两种方式:
1.cast
CAST ( expression AS data_type )
如
select cast( '123 ' as int)
2.convert
CONVERT (data_type[(length)], expression [, style])
如
select convert(int, '123 ')
本文介绍了 SQL Server 中两种常见的字符类型转换方法:cast 和 convert。通过示例演示了如何将字符串转换为整数。
sql server 字符类型转换有两种方式:
1.cast
CAST ( expression AS data_type )
如
select cast( '123 ' as int)
2.convert
CONVERT (data_type[(length)], expression [, style])
如
select convert(int, '123 ')
8082

被折叠的 条评论
为什么被折叠?