|
|
#2
wasdyjyj2008-05-13 11:26
写个批处理执行,然后用shell调用这个批处理程序
@Echo -- 正在计算%1的TAM月度计算,请稍候,本过程可能需要20分钟 Pause @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[DiscountApportionment] '%1'" @Echo -- TAM月度计算 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[MonthTAM_M] '%1'" @Echo -- 非化学品计算 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[NonCheBonus] '%1'" @Echo -- TDM月度计算 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [dbo].[MonthTDM_M] '%1'" @Echo -- 超帐龄扣款计算 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [dbo].[TOBaddebt] '%1'" @Echo -- 超帐龄扣款回款返还 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [dbo].[ReturnBon] '%1'" @Echo -- TAM季度计算 TDM季度计算 @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[MonthQ] '%2'" @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[MonthCSQ] '%2'" @Echo -- TAM月度计算 for SalesCustomer @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[MonthCSTAM_M] '%1'" @Echo -- TDM月度计算 for SalesCustomer @echo sqlcmd -S landesk -U sa -P vmi -Q "EXEC [ZHUANGDB].[dbo].[MonthCSTDM_M] '%1'" @Echo -- 非化学品计算 for SalesCustomer @echo sqlcmd -S landesk -U sa -P vmi -Q " update yearM set yeayn='P' , MoUsr = @MoUsr, Modat = getdate() where s0005= '%1'" pause 这个是我以前做的一个系统执行SQL脚本的批处理,给你参考下 |
我想在窗体的LOAD里面执行SQL脚本,请问怎样完成??