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

sp_Blitz - Arithmetic overflow error #3599

Closed
songomajk opened this issue Dec 14, 2024 · 3 comments · Fixed by #3600
Closed

sp_Blitz - Arithmetic overflow error #3599

songomajk opened this issue Dec 14, 2024 · 3 comments · Fixed by #3600
Assignees

Comments

@songomajk
Copy link

Version of the script
Version = '8.22',
VersionDate = '20241019';

What is the current behavior?
Msg 8115, Level 16, State 7, Line 3
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
Warning: Null value is eliminated by an aggregate or other SET operation.

If the current behavior is a bug, please provide the steps to reproduce.
Running sp_Blitz with these two parameters ( @CheckServerInfo=1, @Bringthepain=1 ) causes the error. It runs perfectly on a small instance (with <100 GB databases) but fails to do the same on a biger one (over Tbyte databases included). It spits out the results, but end up in an error message.

What is the expected behavior?
No error message expected.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
SQL SERVER 2019 (STANDARD - 15.0.4261.1)

@BrentOzar
Copy link
Member

Can you run it with @debug = 1 and copy/paste the output into a text file and attach it here? Thanks!

@songomajk
Copy link
Author

songomajk commented Dec 16, 2024

Thank you for the quick reply, please find the requested output attached.

Error message starts at row # 157.

Msg 8115, Level 16, State 7, Line 6
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.

sp_blitz_debug.txt

@BrentOzar
Copy link
Member

@songomajk perfect, thanks for that! Here's the part of the code that might be at fault:

''The ['' + DB_NAME() + ''] database file '' + f.physical_name + '' has grown to '' + CONVERT(NVARCHAR(10), CONVERT(NUMERIC(38, 2), (f.size / 128.) / 1024.)) + '' GB, and is using percent filegrowth settings. This can lead to slow performance during growths if Instant File Initialization is not enabled.''

Do a search in the code for that, and change the number after NVARCHAR from 10 to 20. Let's see if that fixes the problem.

BrentOzar added a commit that referenced this issue Dec 28, 2024
Really, really big data files would overflow an NVARCHAR(10). Closes #3599.
BrentOzar added a commit that referenced this issue Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants