exec 时出错了,求鉴定!
本帖最后由 dayrenlar 于 2014-01-10 11:10:49 编辑
alter proc[dbo].[Order_set]
(
@Op_en int=null,
@TotalFee decimal (18,2)=null,
@DiscountFee decimal(18,2)=null,
@AdjustFee decimal (18,2)=null,
@Payment decimal (18,2)=null,
@ModifiedTime datetime =null,
@OrderStatus varchar(50)=null,
@RefundID varchar(50)=null,
@RefundStatus varchar(30)=null,
@TradeType varchar(20)=null,
@SkuID varchar(50)=null,
@Number int=null,
@ProductModel varchar(500)=null,
@Price decimal (18,2)=null,
@TID varchar(50)=null,
@OrderID varchar(50) =null,
@ProductID varchar(50) =null,
@CategoryID varchar(50)=null,
@TimeOutAction datetime=null,
@BuyerRate bit=null,
@SellarRate bit=null,
@BuyerPointFee int =null,
@ObjectItems varchar(2000)=null
)
AS
if(@op_en=0)
begin
declare @sql varchar(2000)
set @sql =
'insert into Order_Basicinfo values('''+convert(varchar(30),@TotalFee)+''','''+convert(varchar(30),@DiscountFee)+''','''+convert(varchar(30),@AdjustFee)+''','''+convert(varchar(30),@Payment)+''','''+convert(varchar(30),@ModifiedTime)+''','''+@OrderStatus+''','''+@RefundID+''','''
+@RefundStatus+''','''+@SkuID+''','''+convert(varchar(9),@Number)+''','''+@ProductModel+''','''+convert(varchar(30),@Price)+''','''+@TID+''','''+@OrderID+''','''+@ProductID+''','''+@CategoryID+''','''
+cast(@TimeOutAction as varchar)+'''
,'''+convert(varchar(1),@BuyerRate)+''','''+convert(varchar(1),@SellarRate)+''','''+convert(varchar(9),@BuyerPointFee)+''','''+@TradeType+''')';
exec (@sql)
end