I'm trying to setup a NetScaler (version 9.3) monitor to determine which SQL server my database is running on (principal / mirror). The query I'm using is:
select mirroring_role_desc from sys.database_mirroring where database_id = DB_ID('OperationsManager')
The query works fine running under the user credentials that I created. The problem is, whenever the query comes from the NetScaler it's not completing. In the SQL Profiler trace it's showing an abort / rollback and I have no idea why.
I've enabled literally every trace event, including all the errors, to try to see why it's not completing and I've gotten nowhere. There are no Reads and no RowCounts. The connection appears to be aborting, but not from any sort of error.
This is what profiler looks like when it runs from the NetScaler
This is what it looks like when I run the same query, as the same user, from SSMS.
I thought maybe the NS was closing the connection too early so I upped the response timeout from 2s to 30s. That didn't make any difference. I'm completely baffled.