June 18, 2014 at 7:38 am
I am using a monitoring system where I can monitor a numeric SQL result assuming the result is one field and one row.
I would like to do this to say monitor the free available space or percentage on say the Master database. DBCC SQLPERF gives me a few columns and results for all databases on the server.
Any ideas ?
June 18, 2014 at 7:54 am
Create a temp table, insert the results of the DBCC into there (use EXEC (DBCC...) ), then select from the temp table.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2014 at 11:07 am
I'd use a query something like this:
SELECT
size * 8 / 1024.0 -
FILEPROPERTY(database_files.name, 'SpaceUsed') * 8.0 / 1024 AS free_space_mb
FROM
sys.database_files
The query returns the data for the database context it is executed in.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply