---test1.create table table1(ff nvarchar(10),ffff datetime)2.CREATE PROCEDURE test0529 (@i int, @con int out ) AS BEGIN TRAN set xact_abort on WHILE (@i<10) begin INSERT INTO table1 (ff,ffff) VALUES ('fff',getdate() ) set @i=@i+1 end commit tran set @con=@i GO3.declare @i int exec test0529 1,@i out select @i select * from table14.drop procedure test0529 drop table table1
(@i int,
@con int out
)
AS
BEGIN TRAN
set xact_abort on
WHILE (@i<10)
begin
INSERT INTO table1
(ff,ffff)
VALUES ('fff',getdate() )
set @i=@i+1
end
commit tran
set @con=@i
GO3.declare @i int
exec test0529 1,@i out
select @i
select * from table14.drop procedure test0529
drop table table1
set @i=1
少写了一句