MS SQL 数据类型转换

MS SQL 转换数据类型

select cast(列A as int) 列A

select convert(int,列A) 列A

--转字符串为int

select len(ltrim(str('数字')))
select len(str('数字'))

--转数字为字符串时 要加ltrim 来去掉左边空格

 

posted on 2013-09-29 16:37  z5337  阅读(253)  评论(0)    收藏  举报