What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

MSSQL v2 - No valid datatable was returned

Votes:

0

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.

database mssql prtg

Created on Sep 15, 2016 11:12:39 AM

Last change on Sep 16, 2016 7:09:19 AM by  Stephan Linke [Paessler Support]



3 Replies

Votes:

0

Could you try to add a ; at the end of each line to see if that works out?

Created on Sep 16, 2016 7:09:47 AM by  Stephan Linke [Paessler Support]



Votes:

0

I had to remove all the semicolons at the end of the lines. Else PRTG executes each line independet from each other. So i cant use @first and @second. Found the info about that in another topic in here.

Created on Sep 16, 2016 7:34:27 AM



Votes:

0

Alright then - it's always one way or the other, depending on the database system :) Glad you figured it out, sorry for the inconvenience.

Created on Sep 16, 2016 7:48:12 AM by  Stephan Linke [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.