Original source here
with fs
as
(
select database_id, type, size * 8.0 / 1000 size
from sys.master_files
)
select
name,
(select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeMB,
(select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeMB
from sys.databases db
However not all users have these permissions, script below to check a single table across multiple dbs.
Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts
Tuesday, 22 September 2015
Wednesday, 29 July 2015
Stored Procedure that disables failing Server Agent Jobs
I had a problem, I had a lot of development jobs that ran overnight, when they failed I got an email advising me of this. Then they failed again and again as they kept trying to run, this stored procedure monitors for failing jobs, using a user set limit and emails out a VERY bright red email to advise on what it's done.
Friday, 20 February 2015
TSQL Stored Procedure to disable failing jobs
Procedure to disable failing jobs and email an alert when this happens
Labels:
admin,
email,
rank,
SQL,
stored procedure,
temp tables
Thursday, 8 January 2015
SQL Claims Triangles
Insurance claims triangles, getting the latest outstanding amount and the total amount paid
Includes
Includes
- Temporary Tables
- Updating tables using a join
- While Statements
- Alter statements
SQL Earned Premiums for Triangulations
Query to generate earned premiums, working based off the latest of either the entry date or the inception date
Contains
Contains
- Temporary Tables
- Calculated Columns
- variables
- While Loops
Subscribe to:
Posts (Atom)