Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String fix #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions BPCheck/Check_BP_Servers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6377,7 +6377,7 @@ FROM sys.database_query_store_options;'
SET isdone = 1
WHERE [dbid] = @dbid
END
END
--END

IF (SELECT COUNT([DBName]) FROM #tblQStoreInfo) > 0
BEGIN
Expand All @@ -6391,7 +6391,7 @@ FROM sys.database_query_store_options;'
SELECT 'Information' AS [Category], 'Query_Store' AS [Information] , '[INFORMATION: No databases have Query Store enabled]' AS [Comment];
END
END;

END;
--------------------------------------------------------------------------------------------------------------------------------
-- Automatic Tuning info subsection
--------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -10491,14 +10491,16 @@ END;
--------------------------------------------------------------------------------------------------------------------------------
IF @ptochecks = 1
BEGIN
RAISERROR (N' |-Starting Indexes with large keys (> 900 bytes)', 10, 1) WITH NOWAIT
IF (SELECT COUNT(*) FROM #tblIxs1 WHERE [KeyCols_data_length_bytes] > 900) > 0
declare @MaxIndSize int=Case when @sqlmajorver >= 13 THEN 1700 else 900 End
declare @MaxIndSizeStr varchar(4)=Cast(@MaxIndSize as varchar(4))
RAISERROR (N' |-Starting Indexes with large keys (> %s bytes)', 10, 1,@MaxIndSizeStr) WITH NOWAIT
IF (SELECT COUNT(*) FROM #tblIxs1 WHERE [KeyCols_data_length_bytes] > @MaxIndSize) > 0
BEGIN
SELECT 'Index_and_Stats_checks' AS [Category], 'Large_Index_Key' AS [Check], '[WARNING: Some indexes have keys larger than 900 bytes. It is recommended to revise these]' AS [Deviation]
SELECT 'Index_and_Stats_checks' AS [Category], 'Large_Index_Key' AS [Check], '[WARNING: Some indexes have keys larger than ' + @MaxIndSizeStr + ' bytes. It is recommended to revise these]' AS [Deviation]
SELECT 'Index_and_Stats_checks' AS [Category], 'Large_Index_Key' AS [Information], I.[DatabaseName] AS [Database_Name], I.schemaName AS [Schema_Name], I.[objectName] AS [Table_Name], I.[indexID], I.[indexName] AS [Index_Name],
I.KeyCols, [KeyCols_data_length_bytes]
FROM #tblIxs1 I
WHERE [KeyCols_data_length_bytes] > 900
WHERE [KeyCols_data_length_bytes] > @MaxIndSize
ORDER BY I.[DatabaseName], I.schemaName, I.[objectName], I.[indexID]
END
ELSE
Expand Down