New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


MSSQL v2 - No valid datatable was returned

Votes:

0

Your Vote:

Up

Down

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 by  MAlberer (0) 1

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



3 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  MAlberer (0) 1



Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.