I migrated the following query from mssql v1 sensor to mssql v2.
declare @first BIGINT, @second BIGINT set @first = (select cntr_value from sys.[dm_os_performance_counters] where object_name='SQLServer:Databases' AND counter_name='Transactions/sec' and instance_name='_Total') WAITFOR DELAY '00:00:01' set @second = (select cntr_value from sys.[dm_os_performance_counters] where object_name='SQLServer:Databases' AND counter_name='Transactions/sec' and instance_name='_Total') SELECT @second - @first AS DIFF;
But as result i get "No valid datatable was returned", even though "SELECT @second - @first AS DIFF;" always returns a dataset.
Add comment