Skip to content

Commit 2422c4b

Browse files
authored
Merge pull request BrentOzarULTD#3799 from BrentOzarULTD/3798_sp_Blitz_AI_warning
BrentOzarULTD#3798 sp_Blitz added AI warnings
2 parents baf6cb6 + ee7cd21 commit 2422c4b

2 files changed

Lines changed: 60 additions & 2 deletions

File tree

‎Documentation/sp_Blitz_Checks_by_Priority.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
66

77
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.
88

9-
CURRENT HIGH CHECKID: 272.
10-
If you want to add a new one, start at 273.
9+
CURRENT HIGH CHECKID: 274.
10+
If you want to add a new one, start at 275.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
@@ -60,6 +60,8 @@ If you want to add a new one, start at 273.
6060
| 20 | Reliability | Unsupported Build of SQL Server | https://www.BrentOzar.com/go/unsupported | 128 |
6161
| 20 | Reliability | User Databases on C Drive | https://www.BrentOzar.com/go/cdrive | 26 |
6262
| 20 | Reliability | TempDB on C Drive | https://www.BrentOzar.com/go/cdrive | 25 |
63+
| 50 | AI | Constitution.md Present | https://www.BrentOzar.com/go/constitution | 273 |
64+
| 50 | AI | Agents.md Present | https://www.BrentOzar.com/go/constitution | 274 |
6365
| 50 | DBCC Events | Overall Events | https://www.BrentOzar.com/go/dbcc | 203 |
6466
| 50 | Performance | File Growths Slow | https://www.BrentOzar.com/go/filegrowth | 151 |
6567
| 50 | Performance | Instant File Initialization Not Enabled | https://www.BrentOzar.com/go/instant | 192 |

‎sp_Blitz.sql‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7079,6 +7079,62 @@ IF @ProductVersionMajor >= 10
70797079
OPTION (RECOMPILE)';
70807080
END;
70817081

7082+
IF NOT EXISTS ( SELECT 1
7083+
FROM #SkipChecks
7084+
WHERE DatabaseName IS NULL AND CheckID = 273 )
7085+
BEGIN
7086+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 273) WITH NOWAIT;
7087+
7088+
EXEC dbo.sp_MSforeachdb 'USE [?];
7089+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
7090+
INSERT INTO #BlitzResults
7091+
(CheckID,
7092+
DatabaseName,
7093+
Priority,
7094+
FindingsGroup,
7095+
Finding,
7096+
URL,
7097+
Details)
7098+
SELECT TOP 1 273,
7099+
N''?'',
7100+
50,
7101+
''AI'',
7102+
''Constitution.md Present'',
7103+
''https://www.brentozar.com/go/constitution'',
7104+
''The instructions in the Consitution.md extended property will influence the behavior of AI agents like Copilot, and change the advice they give to end users querying this database. To see the instructions, run the query in the URL.''
7105+
FROM [?].sys.extended_properties
7106+
WHERE class = 0 AND class_desc = ''DATABASE'' AND UPPER(name) = ''CONSTITUTION.MD''
7107+
OPTION (RECOMPILE)';
7108+
END;
7109+
7110+
IF NOT EXISTS ( SELECT 1
7111+
FROM #SkipChecks
7112+
WHERE DatabaseName IS NULL AND CheckID = 274 )
7113+
BEGIN
7114+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 274) WITH NOWAIT;
7115+
7116+
EXEC dbo.sp_MSforeachdb 'USE [?];
7117+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
7118+
INSERT INTO #BlitzResults
7119+
(CheckID,
7120+
DatabaseName,
7121+
Priority,
7122+
FindingsGroup,
7123+
Finding,
7124+
URL,
7125+
Details)
7126+
SELECT TOP 1 274,
7127+
N''?'',
7128+
50,
7129+
''AI'',
7130+
''Agents.md Present'',
7131+
''https://www.brentozar.com/go/constitution'',
7132+
''Objects in this database have extended properties defined which will influence the behavior of AI agents like Copilot, and change the advice they give to end users querying this database. To see the objects and properties, run the query in the URL.''
7133+
FROM [?].sys.extended_properties
7134+
WHERE class = 1 AND UPPER(name) = ''AGENTS.MD''
7135+
OPTION (RECOMPILE)';
7136+
END;
7137+
70827138
IF @ProductVersionMajor = 13 AND @ProductVersionMinor < 2149 --2016 CU1 has the fix in it
70837139
AND NOT EXISTS ( SELECT 1
70847140
FROM #SkipChecks

0 commit comments

Comments
 (0)