select id+',' from [dbo].[D_productArcTypeMapping]会提示
消息 245,级别 16,状态 1,第 1 行
在将 varchar 值 ',' 转换成数据类型 int 时失败。除非将ID转成varchar 我感觉比较麻烦有没有更好方法

解决方案 »

  1.   

    select ltrim(id)+',' from [dbo].[D_productArcTypeMapping]
    select cast(id as varchar)+',' from [dbo].[D_productArcTypeMapping]
      

  2.   

    select convert(varchar(8),id)+',' from [dbo].[D_productArcTypeMapping]
      

  3.   

    select LTRIM(ID)+',' from [dbo].[D_productArcTypeMapping]
      

  4.   

    select cast(id as varchar(10))+',' from [dbo].[D_productArcTypeMapping]
      

  5.   

    除非将ID转成varchar 我感觉比较麻烦有没有更好方法  只能去转换一下吧。