谢谢stuwe的测试,我下面把分析数据贴出来,希望有高手可以解决。。。
adoqeury2在前adoquery1在后,可以保存数据的事件探查结果
1、set implicit_transactions on
2、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, NULL, N'insert into test2(c,d)
', 1
select @P1
3、SET FMTONLY ON select c,d from test2 SET FMTONLY OFF
4、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, N'@P1 char(10),@P2 char(10)', N'insert into test2(c,d)
values(@P1,@P2)
', 1
select @P1
5、sp_unprepare 1
6、sp_executesql N'insert into test2(c,d)
values(@P1,@P2)
', N'@P1 varchar(10),@P2 varchar(10)', 'ccccccc', 'ddddddd'
7、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, NULL, N'select * from test1
', 1
select @P1
8、sp_unprepare 2
9、SET NO_BROWSETABLE ON
10、select * from test1
11、sp_executesql N'INSERT INTO "TestDB".."test1" ("a","b") VALUES (@P1,@P2)', N'@P1 varchar(10),@P2 varchar(10)', 'aaaaaa ', 'bbbbbb '
12、SELECT @@IDENTITY
13、IF @@TRANCOUNT > 0 COMMIT TRAN
adoqeury1在前adoquery2在后,不能保存数据的事件探查结果
1、set implicit_transactions on
2、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, NULL, N'select * from test1
', 1
select @P1
3、sp_unprepare 1
4、SET NO_BROWSETABLE ON
5、select * from test1
6、sp_executesql N'INSERT INTO "TestDB".."test1" ("a","b") VALUES (@P1,@P2)', N'@P1 varchar(10),@P2 varchar(10)', 'aaaaaa ', 'bbbbbb '
7、SELECT @@IDENTITY
8、SET NO_BROWSETABLE OFF
9、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, NULL, N'insert into test2(c,d)
', 1
select @P1
10、SET FMTONLY ON select c,d from test2 SET FMTONLY OFF
11、declare @P1 int
set @P1=NULL
exec sp_prepare @P1 output, N'@P1 char(10),@P2 char(10)', N'insert into test2(c,d)
values(@P1,@P2)
', 1
select @P1
12、sp_unprepare 2
13、sp_executesql N'insert into test2(c,d)
values(@P1,@P2)
', N'@P1 varchar(10),@P2 varchar(10)', 'ccccccc', 'ddddddd'
14、IF @@TRANCOUNT > 0 COMMIT TRAN