Skip to content

Commit

Permalink
2019-01 Release (#1932)
Browse files Browse the repository at this point in the history
* Updating readme.md for sp_DatabaseRestore

Documenting @ExistingDBAction for https://dba.stackexchange.com/questions/226145/sp-databaserestore-msg-50000.

* 1900 sp_BlitzIndex add histograms

When @TableName is specified and sys.dm_db_stats_histogram is available. Closes #1900.

* #1903 sp_Blitz SQLServerCheckup

Adding filter for that app name. Closes #1903.

* #1905 sp_BlitzIndex remove BOU link

Nothing against BOU, just don't need it in that particular place. Closes #1905.

* #1908 Update copyright dates

Ah, the glamour. Closes #1908.

* Issue #1904 Change RAISERROR 'severity' for that should trigger throw and error.

* Issue #1910 Add SQL Server version check before choosing 'memory grant' as the @BlitzCacheSortOrder.

* Issue #1910 Add temp table creation.

* #1914 sp_BlitzIndex partition error severity

Dropping severity level from 16 to 0 since we're logging it in the result set anyway. Closes #1914.

* Issue 1894 Moved RESTORE HEADERONLY up

* LF line endings

* added some extra checks + corrected some nesting

* rebase and line endings

* Web site commit

Does this fix line endings?

* #1916 sp_Blitz ignore backup on TempDB drive

Closes #1916.

* Auto line endings

Dealing with sp_DatabaseRestore's line endings.

* 1919 sp_Blitz ignoring a few checks for Managed Instances (#1920)

* 1919 sp_Blitz ignoring a few checks for Managed Instances

Working on #1919.

* #1919 sp_Blitz excluding restored databases

When checking backup history. Working on #1919.

* #1919 sp_Blitz ignore some checks on Mgd Instances

Changing RCSI wording on Azure SQL DB. Working on #1919.

* #1921 Sp_BlitzIndex Add Drop and Create Columns to Output (#1923)

Joined output query to #IndexCreateTsql to retrieve the CreateTsql already generated earlier in the script.  Created Drop TSQL based off evaluating what type of index was present.

* #1921 sp_BlitzIndex adding drops (#1924)

Moving drop and create TSQL to the end of mode 2's results. Closes #1921.

* #1925 sp_Blitz AWS RDS detection (#1926)

Don't just rely on EC2 VM name to detect RDS. Also adds a new result noting that checks were skipped. Closes #1925.

* #1927 sp_BlitzIndex skip rdsadmin db (#1928)

GetAllDatabases = 1 fails when it hits rdsadmin because they're referring to the resource db. Closes #1927.

* 2019_01 Release (#1931)

Prep work for the release - changing version numbers, building build scripts.
  • Loading branch information
BrentOzar authored Jan 28, 2019
1 parent 301f1aa commit 30f5b42
Show file tree
Hide file tree
Showing 22 changed files with 2,267 additions and 1,789 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Force this repository to use Windows line endings
* text=crlf
* text=auto

# Custom for Visual Studio
*.ascx text
Expand Down
7 changes: 4 additions & 3 deletions Documentation/sp_Blitz Checks by Priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Before adding a new check, make sure to add a Github issue for it first, and hav

If you want to change anything about a check - the priority, finding, URL, or ID - open a Github issue first. The relevant scripts have to be updated too.

CURRENT HIGH CHECKID: 222.
If you want to add a new one, start at 223.
CURRENT HIGH CHECKID: 223.
If you want to add a new one, start at 224.

| Priority | FindingsGroup | Finding | URL | CheckID |
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
| 0 | Outdated sp_Blitz | sp_Blitz is Over 6 Months Old | https://www.BrentOzar.com/blitz/ | 155 |
| 0 | Informational | @CheckUserDatabaseObjects Disabled | https://www.BrentOzar.com/blitz/ | 204 |
| 0 | Informational | @CheckUserDatabaseObjects Disabled | https://www.BrentOzar.com/blitz/ | 223 |
| 0 | Informational | Some Checks Skipped | https://www.BrentOzar.com/blitz/ | 204 |
| 1 | Backup | Backing Up to Same Drive Where Databases Reside | https://www.BrentOzar.com/go/backup | 93 |
| 1 | Backup | Backups Not Performed Recently | https://www.BrentOzar.com/go/nobak | 1 |
| 1 | Backup | Encryption Certificate Not Backed Up Recently | https://www.BrentOzar.com/go/tde | 202 |
Expand Down
1,048 changes: 577 additions & 471 deletions Install-All-Scripts.sql
100644 → 100755

Large diffs are not rendered by default.

233 changes: 182 additions & 51 deletions Install-Core-Blitz-No-Query-Store.sql
100644 → 100755

Large diffs are not rendered by default.

243 changes: 185 additions & 58 deletions Install-Core-Blitz-With-Query-Store.sql
100644 → 100755

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ MIT License
Copyright for portions of sp_Blitz are held by Microsoft as part of project
tigertoolbox and are provided under the MIT license:
https://github.com/Microsoft/tigertoolbox
All other copyrights for sp_Blitz are held by Brent Ozar Unlimited, 2018 as
All other copyrights for sp_Blitz are held by Brent Ozar Unlimited, 2019 as
described below.

Copyright for portions of DatabaseRestore are held by GregWhiteDBA as part
of project MSSQLAutoRestore and are provided under the MIT license:
https://github.com/GregWhiteDBA/MSSQLAutoRestore
All other copyrights for DatabaseRestore are held by Brent Ozar Unlimited, 2018
All other copyrights for DatabaseRestore are held by Brent Ozar Unlimited, 2019
as described below.

Copyright for sp_BlitzInMemoryOLTP are held by Ned Otter and Konstantin
Taranov as part of project sqlserver-kit and are provided under the MIT license:
https://github.com/ktaranov/sqlserver-kit

Copyright for SqlServerVersionScript are held by Josh Darnell as part of
project SqlServerVersionScript and are provided undre the MIT license:
https://github.com/jadarnel27/SqlServerVersionScript

Copyright (c) 2018 Brent Ozar Unlimited

Copyright (c) 2019 Brent Ozar Unlimited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ Parameters include:
* @RestoreDiff - default 0. When set to 1, we restore the ncessary full, differential, and log backups (instead of just full and log) to get to the most recent point in time.
* @ContinueLogs - default 0. When set to 1, we don't restore a full or differential backup - we only restore the transaction log backups. Good for continuous log restores with tools like sp_AllNightLog.
* @RunRecovery - default 0. When set to 1, we run RESTORE WITH RECOVERY, putting the database into writable mode, and no additional log backups can be restored.
* @ExistingDBAction - if the database already exists when we try to restore it, 1 sets the database to single user mode, 2 kills the connections, and 3 kills the connections and then drops the database.
* @Debug - default 0. When 1, we print out messages of what we're doing in the messages tab of SSMS.
* @StopAt NVARCHAR(14) - pass in a date time to stop your restores at a time like '20170508201501'.

Expand Down
2 changes: 2 additions & 0 deletions SqlServerVersions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ VALUES
(14, 3008, 'RTM CU2', 'https://support.microsoft.com/en-us/help/4052574', '2017-11-28', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 2'),
(14, 3006, 'RTM CU1', 'https://support.microsoft.com/en-us/help/4038634', '2017-10-24', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 1'),
(14, 1000, 'RTM ', '', '2017-10-02', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM '),
(13, 5264, 'SP2 CU5', 'https://support.microsoft.com/en-us/help/4475776', '2019-01-23', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 5'),
(13, 5233, 'SP2 CU4', 'https://support.microsoft.com/en-us/help/4464106', '2018-11-13', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 4'),
(13, 5216, 'SP2 CU3', 'https://support.microsoft.com/en-us/help/4458871', '2018-09-20', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 3'),
(13, 5201, 'SP2 CU2 + Security Update', 'https://support.microsoft.com/en-us/help/4458621', '2018-08-21', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 2 + Security Update'),
(13, 5153, 'SP2 CU2', 'https://support.microsoft.com/en-us/help/4340355', '2018-07-16', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 2'),
(13, 5149, 'SP2 CU1', 'https://support.microsoft.com/en-us/help/4135048', '2018-05-30', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 1'),
(13, 5026, 'SP2 ', 'https://support.microsoft.com/en-us/help/4052908', '2018-04-24', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 '),
(13, 4550, 'SP2 CU13', 'https://support.microsoft.com/en-us/help/4475775', '2019-01-23', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 13'),
(13, 4541, 'SP2 CU12', 'https://support.microsoft.com/en-us/help/4464343', '2018-11-13', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 2 Cumulative Update 12'),
(13, 4528, 'SP1 CU11', 'https://support.microsoft.com/en-us/help/4459676', '2018-09-17', '2019-07-09', '2019-07-09', 'SQL Server 2016', 'Service Pack 1 Cumulative Update 11'),
(13, 4514, 'SP1 CU10', 'https://support.microsoft.com/en-us/help/4341569', '2018-07-16', '2019-07-09', '2019-07-09', 'SQL Server 2016', 'Service Pack 1 Cumulative Update 10'),
Expand Down
6 changes: 3 additions & 3 deletions sp_AllNightLog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ SET NOCOUNT ON;
BEGIN;

DECLARE @Version VARCHAR(30);
SET @Version = '3.1';
SET @VersionDate = '20190101';
SET @Version = '3.2';
SET @VersionDate = '20190128';

IF @Help = 1

Expand Down Expand Up @@ -76,7 +76,7 @@ BEGIN
MIT License
Copyright (c) 2018 Brent Ozar Unlimited
Copyright (c) 2019 Brent Ozar Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions sp_AllNightLog_Setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ SET NOCOUNT ON;
BEGIN;

DECLARE @Version VARCHAR(30);
SET @Version = '3.1';
SET @VersionDate = '20190101';;
SET @Version = '3.2';
SET @VersionDate = '20190128';;


IF @Help = 1
Expand Down Expand Up @@ -111,7 +111,7 @@ BEGIN
MIT License
Copyright (c) 2018 Brent Ozar Unlimited
Copyright (c) 2019 Brent Ozar Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
71 changes: 63 additions & 8 deletions sp_Blitz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ AS
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
DECLARE @Version VARCHAR(30);
SET @Version = '7.1';
SET @VersionDate = '20190101';
SET @Version = '7.2';
SET @VersionDate = '20190128';
SET @OutputType = UPPER(@OutputType);

IF @Help = 1 PRINT '
Expand Down Expand Up @@ -82,9 +82,9 @@ AS
tigertoolbox and are provided under the MIT license:
https://github.com/Microsoft/tigertoolbox
All other copyright for sp_Blitz are held by Brent Ozar Unlimited, 2018.
All other copyright for sp_Blitz are held by Brent Ozar Unlimited, 2019.
Copyright (c) 2018 Brent Ozar Unlimited
Copyright (c) 2019 Brent Ozar Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -301,6 +301,8 @@ AS
IF LEFT(CAST(SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS VARCHAR(8000)), 8) = 'EC2AMAZ-'
AND LEFT(CAST(SERVERPROPERTY('MachineName') AS VARCHAR(8000)), 8) = 'EC2AMAZ-'
AND LEFT(CAST(SERVERPROPERTY('ServerName') AS VARCHAR(8000)), 8) = 'EC2AMAZ-'
AND db_id('rdsadmin') IS NOT NULL
AND EXISTS(SELECT * FROM master.sys.all_objects WHERE name IN ('rds_startup_tasks', 'rds_help_revlogin', 'rds_hexadecimal', 'rds_failover_tracking', 'rds_database_tracking', 'rds_track_change'))
BEGIN
INSERT INTO #SkipChecks (CheckID) VALUES (6);
INSERT INTO #SkipChecks (CheckID) VALUES (29);
Expand Down Expand Up @@ -328,6 +330,20 @@ AS
INSERT INTO #SkipChecks (CheckID) VALUES (211); /* xp_regread checking for power saving */
INSERT INTO #SkipChecks (CheckID) VALUES (212); /* xp_regread */
INSERT INTO #SkipChecks (CheckID) VALUES (219);
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 223 AS CheckID ,
0 AS Priority ,
'Informational' AS FindingsGroup ,
'Some Checks Skipped' AS Finding ,
'https://aws.amazon.com/rds/sqlserver/' AS URL ,
'Amazon RDS detected, so we skipped some checks that are not currently possible, relevant, or practical there.' AS Details;
END; /* Amazon RDS skipped checks */

/* If the server is ExpressEdition, skip checks that it doesn't allow */
Expand All @@ -338,14 +354,32 @@ AS
INSERT INTO #SkipChecks (CheckID) VALUES (61); /* Agent alerts 19-25 */
INSERT INTO #SkipChecks (CheckID) VALUES (73); /* Failsafe operator */
INSERT INTO #SkipChecks (CheckID) VALUES (96); /* Agent alerts for corruption */
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 223 AS CheckID ,
0 AS Priority ,
'Informational' AS FindingsGroup ,
'Some Checks Skipped' AS Finding ,
'https://stackoverflow.com/questions/1169634/limitations-of-sql-server-express' AS URL ,
'Express Edition detected, so we skipped some checks that are not currently possible, relevant, or practical there.' AS Details;
END; /* Express Edition skipped checks */

/* If the server is an Azure Managed Instance, skip checks that it doesn't allow */
IF SERVERPROPERTY('EngineEdition') = 8
BEGIN
INSERT INTO #SkipChecks (CheckID) VALUES (1); /* Full backups - because of the MI GUID name bug mentioned here: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1481 */
INSERT INTO #SkipChecks (CheckID) VALUES (2); /* Log backups - because of the MI GUID name bug mentioned here: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1481 */
INSERT INTO #SkipChecks (CheckID) VALUES (6); /* Security - Jobs Owned By Users per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */
INSERT INTO #SkipChecks (CheckID) VALUES (21); /* Informational - Database Encrypted per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */
INSERT INTO #SkipChecks (CheckID) VALUES (24); /* File Configuration - System Database on C Drive per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */
INSERT INTO #SkipChecks (CheckID) VALUES (50); /* Max Server Memory Set Too High - because they max it out */
INSERT INTO #SkipChecks (CheckID) VALUES (55); /* Security - Database Owner <> sa per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */
INSERT INTO #SkipChecks (CheckID) VALUES (74); /* TraceFlag On - because Azure Managed Instances go wild and crazy with the trace flags */
INSERT INTO #SkipChecks (CheckID) VALUES (97); /* Unusual SQL Server Edition */
INSERT INTO #SkipChecks (CheckID) VALUES (100); /* Remote DAC disabled - but it's working anyway, details here: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1481 */
Expand All @@ -356,6 +390,20 @@ AS
INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'model'); /* Max file size set */
INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'msdb'); /* Max file size set */
INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'tempdb'); /* Max file size set */
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 223 AS CheckID ,
0 AS Priority ,
'Informational' AS FindingsGroup ,
'Some Checks Skipped' AS Finding ,
'https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-index' AS URL ,
'Managed Instance detected, so we skipped some checks that are not currently possible, relevant, or practical there.' AS Details;
END; /* Azure Managed Instance skipped checks */

/*
Expand Down Expand Up @@ -953,7 +1001,8 @@ AS
UPPER(LEFT(bmf.physical_device_name COLLATE SQL_Latin1_General_CP1_CI_AS, 3)) IN (
SELECT DISTINCT
UPPER(LEFT(mf.physical_name COLLATE SQL_Latin1_General_CP1_CI_AS, 3))
FROM sys.master_files AS mf )
FROM sys.master_files AS mf
WHERE mf.database_id <> 2 )
AND rh.destination_database_name IS NULL
GROUP BY UPPER(LEFT(bmf.physical_device_name, 3));
END;
Expand Down Expand Up @@ -1044,7 +1093,9 @@ AS
( 'Database backup history retained back to '
+ CAST(bs.backup_start_date AS VARCHAR(20)) ) AS Details
FROM msdb.dbo.backupset bs
ORDER BY backup_start_date ASC;
LEFT OUTER JOIN msdb.dbo.restorehistory rh ON bs.database_name = rh.destination_database_name
WHERE rh.destination_database_name IS NULL
ORDER BY bs.backup_start_date ASC;
END;
END;

Expand Down Expand Up @@ -3959,7 +4010,9 @@ AS
FROM sys.all_columns
WHERE name = 'snapshot_isolation_state' AND object_id = OBJECT_ID('sys.databases');
INSERT INTO #DatabaseDefaults
SELECT 'is_read_committed_snapshot_on', 0, 133, 210, 'Read Committed Snapshot Isolation Enabled', 'https://BrentOzar.com/go/dbdefaults', NULL
SELECT 'is_read_committed_snapshot_on',
CASE WHEN SERVERPROPERTY('EngineEdition') = 5 THEN 1 ELSE 0 END, /* RCSI is always enabled in Azure SQL DB per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */
133, 210, CASE WHEN SERVERPROPERTY('EngineEdition') = 5 THEN 'Read Committed Snapshot Isolation Disabled' ELSE 'Read Committed Snapshot Isolation Enabled' END, 'https://BrentOzar.com/go/dbdefaults', NULL
FROM sys.all_columns
WHERE name = 'is_read_committed_snapshot_on' AND object_id = OBJECT_ID('sys.databases');
INSERT INTO #DatabaseDefaults
Expand Down Expand Up @@ -4007,7 +4060,8 @@ AS
INSERT INTO #DatabaseDefaults
SELECT 'is_memory_optimized_elevate_to_snapshot_on', 0, 144, 210, 'Memory Optimized Enabled', 'https://BrentOzar.com/go/dbdefaults', NULL
FROM sys.all_columns
WHERE name = 'is_memory_optimized_elevate_to_snapshot_on' AND object_id = OBJECT_ID('sys.databases');
WHERE name = 'is_memory_optimized_elevate_to_snapshot_on' AND object_id = OBJECT_ID('sys.databases')
AND SERVERPROPERTY('EngineEdition') <> 8; /* Hekaton is always enabled in Managed Instances per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */

DECLARE DatabaseDefaultsLoop CURSOR FOR
SELECT name, DefaultValue, CheckID, Priority, Finding, URL, Details
Expand Down Expand Up @@ -4778,6 +4832,7 @@ IF @ProductVersionMajor >= 10
AND d.application_name NOT LIKE '%Red Gate Software Ltd SQL Prompt%'
AND d.application_name NOT LIKE '%Spotlight Diagnostic Server%'
AND d.application_name NOT LIKE '%SQL Diagnostic Manager%'
AND d.application_name NOT LIKE 'SQL Server Checkup%'
AND d.application_name NOT LIKE '%Sentry%'
AND d.application_name NOT LIKE '%LiteSpeed%'
AND d.application_name NOT LIKE '%SQL Monitor - Monitoring%'
Expand Down
18 changes: 9 additions & 9 deletions sp_BlitzBackups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ AS
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
DECLARE @Version VARCHAR(30);
SET @Version = '3.1';
SET @VersionDate = '20190101';
SET @Version = '3.2';
SET @VersionDate = '20190128';

IF @Help = 1 PRINT '
/*
Expand Down Expand Up @@ -64,7 +64,7 @@ AS
MIT License
Copyright (c) 2018 Brent Ozar Unlimited
Copyright (c) 2019 Brent Ozar Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -237,7 +237,7 @@ CREATE TABLE #Warnings

IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = @MSDBName)
BEGIN
RAISERROR('@MSDBName was specified, but the database does not exist.', 0, 1) WITH NOWAIT;
RAISERROR('@MSDBName was specified, but the database does not exist.', 16, 1) WITH NOWAIT;
RETURN;
END

Expand Down Expand Up @@ -1149,21 +1149,21 @@ DECLARE @RemoteCheck TABLE (c INT NULL);

IF @WriteBackupsToDatabaseName IS NULL
BEGIN
RAISERROR('@WriteBackupsToDatabaseName can''t be NULL.', 0, 1) WITH NOWAIT
RAISERROR('@WriteBackupsToDatabaseName can''t be NULL.', 16, 1) WITH NOWAIT
RETURN;
END

IF LOWER(@WriteBackupsToDatabaseName) = N'msdb'
BEGIN
RAISERROR('We can''t write to the real msdb, we have to write to a fake msdb.', 0, 1) WITH NOWAIT
RAISERROR('We can''t write to the real msdb, we have to write to a fake msdb.', 16, 1) WITH NOWAIT
RETURN;
END

IF @WriteBackupsToListenerName IS NULL
BEGIN
IF @AGName IS NULL
BEGIN
RAISERROR('@WriteBackupsToListenerName and @AGName can''t both be NULL.', 0, 1) WITH NOWAIT;
RAISERROR('@WriteBackupsToListenerName and @AGName can''t both be NULL.', 16, 1) WITH NOWAIT;
RETURN;
END
ELSE
Expand All @@ -1187,7 +1187,7 @@ BEGIN
)
BEGIN
SET @msg = N'We need a linked server to write data across. Please set one up for ' + @WriteBackupsToListenerName + N'.';
RAISERROR(@msg, 0, 1) WITH NOWAIT;
RAISERROR(@msg, 16, 1) WITH NOWAIT;
RETURN;
END
END
Expand All @@ -1206,7 +1206,7 @@ END
IF @@ROWCOUNT = 0
BEGIN
SET @msg = N'The database ' + @WriteBackupsToDatabaseName + N' doesn''t appear to exist on that server.'
RAISERROR(@msg, 0, 1) WITH NOWAIT
RAISERROR(@msg, 16, 1) WITH NOWAIT
RETURN;
END

Expand Down
6 changes: 3 additions & 3 deletions sp_BlitzCache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

DECLARE @Version VARCHAR(30);
SET @Version = '7.1';
SET @VersionDate = '20190101';
SET @Version = '7.2';
SET @VersionDate = '20190128';

IF @Help = 1 PRINT '
sp_BlitzCache from http://FirstResponderKit.org
Expand Down Expand Up @@ -301,7 +301,7 @@ https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/
MIT License
Copyright (c) 2018 Brent Ozar Unlimited
Copyright (c) 2019 Brent Ozar Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 30f5b42

Please sign in to comment.