CREATE PROCEDURE insertbg
@tp_ref_price numeric(18,0)
as
if @tp_ref_price is null set @tp_ref_price=null
 begin
  insert into t_prd_info(test) values(@tp_ref_price)
end
GO

解决方案 »

  1.   

    CREATE PROCEDURE insertbg
    @tp_ref_price numeric(18,0)
    as
    if @tp_ref_price is null
    begin
    insert into t_prd_info(test) values(@tp_ref_price)
             end
    GO
      

  2.   

    这样就可以了吧:CREATE PROCEDURE insertbg
    @tp_ref_price numeric(18,0)
    as
    insert t_prd_info(test) values(@tp_ref_price)
    go
      

  3.   

    这样就可以了吧:CREATE PROCEDURE insertbg
    @tp_ref_price numeric(18,0)
    as
    insert t_prd_info(test) values(@tp_ref_price)
    go
      

  4.   

    CREATE PROCEDURE insertbg
    @tp_ref_price numeric(18,0)
    ------------------------
    你的问题出在开头,入口参数定义为numeric(18,0),你给的可能有空等非numeric型情况。
    建议入口参数定为varchar型,再在排除非numeric型情况后用convert(numeric(18.0),你的字符串型数据)显性转换。