我正在使用以下查询。openquery apears完成后回滚
select * from OPENQUERY(EXITWEB,N'SET NOCOUNT ON;
declare @result table (id int);
insert into [system_files] ([is_public], [file_name], [file_size], [content_type], [disk_name], [updated_at], [created_at])
output inserted.id into @result(id)
values (N''1'',N''7349.jpg'',N''146921'',N''image/jpeg'',N''5799dcc8a1eb1413195192.jpg'',N''2016-07-28 10:22:00.000'',N''2016-07-28 10:22:00.000'')
declare @id int = (select top 1 id from @result)
select * from system_files where id = @id
insert into linkToExternal (id, id_ext) values(@id, 47)
--select @id
')
当我从查询中进行选择它工作得很好:
但是,当我去检查我的数据库,当呼叫结束后,记录不再出现。
所以我怀疑一个事务回滚。我的问题是:为什么。如果是这种情况,我可以做些什么来防止事务被回滚。