Forum Discussion

ldoodle's avatar
ldoodle
Icon for Advisor rankAdvisor
2 months ago

SQL Query Datasource (T-SQL)

I have a T-SQL query for showing disk IO stats (from 'sys.dm_io_virtual_file_stats'). I'd like to present this table data to a widget on a dashboard.

What is the best/most efficient way of doing this? This is something I've not explored before (T-SQL specifically), but have done similar with custom PowerShell/WMI/Groovy so the principle knowledge is good.

Thanks

2 Replies

  • To conceptualize how to accomplish this, you might consider reviewing our official Microsoft SQL Server DataSources, like Microsoft_SQLServer_DatabaseFiles or Microsoft_SQLServer_DatabaseStorage.

  • Thanks Patrick_Rouse​ I already did exactly that. I used the GlobalPerformance once and spawned off my own T-SQL inside that, replacing the original.

    Works an absolute treat. I grouped the data per-instance rather than per-database otherwise the list would be huge for larger environments. It still gives you a nod to go and investigate.