如何将char类型数据转化为int
如何将char类型数据转化为int? 
 这样转化后数据库的查询效率会不会高些?
------解决方案--------------------cast( '234 ' as int)
------解决方案--------------------cast (field as int)     
 ***************************************************************************** 
 欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)    
 最新版本:20070130   
 http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方案--------------------cast( '123 ' as int)   
 --or   
 convert(int, '123 ')
------解决方案--------------------declare @a char(10) 
 set @a= '345 ' 
 if isnumeric(@a)=1 
 begin 
 print cast(@a as int) 
 end 
 else 
 print @a+ '不是数字型 '     
 -------- 
 345
------解决方案----------------------- 
 rookie_one 说的那个判断不知道怎么加上去,我要转化一列的数据 
 --   
 ----------------- 
 select  
 case when isnumeric([ID])=1 then cast([ID] as int) else [ID] end into newtable  
 from oldtable
------解决方案--------------------先判断一下这列是不是都是数字型 
 select count(*) from [tablename] where isnumeric([ID])=0 
 如果结果为0那就可以运行下边这个直接转化列数据类型    
 alter table [tablename] alter column [colname] int