我的语法是这样 create proc delsql @starttime datetime,--起始时间 @endtime datetime --终止时间 as delete from BALANCE where leavdate between @STARTTIME AND @ENDTIME GO delete from CHKINFO where leavdate between @STARTTIME AND @ENDTIME GO delete from tbldispatch where leavdate between @STARTTIME AND @ENDTIME
刚才照二楼的朋友的意思,我通过事务来做,不知道是不是这样写的,现在在家,没有数据库可测 create proc delsql @starttime datetime,--起始时间 @endtime datetime --终止时间 as BEGIN TRANSACTION del delete from BALANCE where leavdate between @STARTTIME AND @ENDTIME GO delete from CHKINFO where leavdate between @STARTTIME AND @ENDTIME GO delete from tbldispatch where leavdate between @STARTTIME AND @ENDTIME go COMMIT TRANSACTION del 然后我执行 exec delsql '20050101','20060101'