Цитата:
Сообщение от
Logger
Vadik, а вы уверены что именно NoCount может так гадить ?
да, уверен
я по-быстрому проверил на SQL Server 2019, на нем изменение переменных сессии откатывается
X++:
use tempdb
go
set nocount off
go
select count(*) from sys.objects
go
create procedure myProc as begin
set nocount on;
-- do something
end
go
execute myProc
go
drop procedure myProc;
go
select count(*) from sys.objects
go
результат
Цитата:
-----------
100
(1 row affected)
-----------
100
(1 row affected)
с
документацией согласуется
Цитата:
If a SET statement runs in a stored procedure or trigger, the value of the SET option gets restored after the stored procedure or trigger returns control. Also, if you specify a SET statement in a dynamic SQL string that runs by using either sp_executesql or EXECUTE, the value of the SET option gets restored after control returns from the batch that you specified in the dynamic SQL string
быстро проверить на более ранних версиях SQL Server времени нет, увы
на AX2012, при возможности проверю.
T-SQL c NOCOUNT из X++ должен валиться
P.S. подчеркнутое расходится с
Цитата:
if you specify a SET statement in a dynamic SQL string that runs by using either sp_executesql or EXECUTE, the value of the SET option gets restored after control returns from the batch that you specified in the dynamic SQL string
непонятно. похоже не было раньше такого поведения