declare @updatecount int
begin TRAN
DECLARE @tbid INT
SELECT @tbid=iMax FROM tbID WHERE strName='ipcclid'
INSERT into pccl(ipcid,cph,crkdbh,drq,iywdwid,cywdwbh,cywdwmc,iclbh,cclbh,cclmc,
cgg,cdw,nwjsl,nwjdj,nwjje,cRemark,cPeriod,cBillCode_Buy,cBuyUnit,nBuyAmount,
nAmount_In,nBuyUnitRate,FBuyUnitRate,cBuyRate,nBuyPrice,nTaxBuyPrice,nBuyTickAmount,nTaxFBuyPrice,ID_Money,cForeignName,
nForeignRate,nTaxRate,nTaxPrice,iMaterialState)
VALUES(@tbid,'','RK000398',CONVERT(DATETIME,'2015-12-24',120),36,'G0025','泉州经济技术开发区新安消防器材经营部',1691,'10030050','安全出品灯(正)',
'3W','个',3,38,114,'移动端[CG000521]','2015年12月','CG000521','个',3,
3,1,'1/1',1,38,38,3,38,1,'本位币',
1,0,38,0)
SET @tbid += 1
INSERT into pccl(ipcid,cph,crkdbh,drq,iywdwid,cywdwbh,cywdwmc,iclbh,cclbh,cclmc,
cgg,cdw,nwjsl,nwjdj,nwjje,cRemark,cPeriod,cBillCode_Buy,cBuyUnit,nBuyAmount,
nAmount_In,nBuyUnitRate,FBuyUnitRate,cBuyRate,nBuyPrice,nTaxBuyPrice,nBuyTickAmount,nTaxFBuyPrice,ID_Money,cForeignName,
nForeignRate,nTaxRate,nTaxPrice,iMaterialState)
VALUES(@tbid,'','RK000399',CONVERT(DATETIME,'2015-12-24',120),36,'G0025','泉州经济技术开发区新安消防器材经营部',1692,'10030051','安全出口灯(左)',
'3W','个',4,38,152,'移动端[CG000521]','2015年12月','CG000521','个',3,
4,1,'1/1',1,38,38,4,38,1,'本位币',
1,0,38,0)
SET @tbid += 1
UPDATE tbID SET iMax=@tbid WHERE strName='ipcclid'
set @updatecount = @@rowcount
if(@updatecount = 1)
begin
commit tran
print 'chenggomg'
end
else
begin
rollback tran
print 'shibai'
end