日期:2014-05-17 浏览次数:20544 次
ALTER PROCEDURE [dbo].[Inotone_Add_InotoneOrderBillSub] ( @RenewalsID VARCHAR(50) , @OrderCode CHAR(20) , @PurchaseDate DATETIME , @ProductCode VARCHAR(50) , @ProductNum INT , @IsTime INT , @kaishiDate DATETIME , @jieshuDate DATETIME , @IsValid INT , @OrderDes VARCHAR(500), @kind int --判断类型 ) AS BEGIN SET NOCOUNT ON declare @RandomCode INT --生成的随机数 set @randomcode=RAND(100) if(@kind=1) begin INSERT INTO InotoneOrderBillSub ( OrderBillSubID , RenewalsID , OrderCode , PurchaseDate , ProductCode , ProductNum , IsTime , kaishiDate , jieshuDate , IsValid OrderDes ) VALUES ( NEWID() , @RenewalsID , @OrderCode , @PurchaseDate , @ProductCode , @ProductNum , @IsTime , @kaishiDate , @jieshuDate , @IsValid , @OrderDes ) end else begin INSERT INTO InotoneOrderBillSub ( OrderBillSubID , RenewalsID , OrderCode , PurchaseDate , ProductCode , ProductNum , IsTime , kaishiDate , jieshuDate , IsValid , OrderDes,randcode ) VALUES ( NEWID() , @RenewalsID , @OrderCode , @PurchaseDate , @ProductCode , @ProductNum , @IsTime , @kaishiDate , @jieshuDate , @IsValid , @OrderDes,@randcode ) end IF @@ROWCOUNT > 0 BEGIN SELECT 1 END ELSE BEGIN SELECT -1 END SET NOCOUNT OFF END