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

SQLWATCH 4.3: usp_sqlwatch_logger_disk_utilisation: sp_spaceused returns non-numeric data #451

Open
kekcjkee opened this issue Aug 9, 2022 · 2 comments

Comments

@kekcjkee
Copy link
Contributor

kekcjkee commented Aug 9, 2022

Describe the bug

insert into @spaceused
	exec [dbo].[usp_sqlwatch_internal_foreachdb] @command = 'use [?]; exec sp_spaceused @oneresultset = 1;'
		, @snapshot_type_id = @snapshot_type_id
		, @calling_proc_id = @@PROCID
		, @databases = @databases

The script for my one database returns resultset which contains nvarchar symbols "*". During execution procedure "usp_sqlwatch_internal_foreachdb" returns the error:

Msg 8114, Level 16, State 5, Procedure usp_sqlwatch_logger_disk_utilisation, Line 215 [Batch Start Line 0]
Error converting data type varchar to numeric.

I think it depends on size of a database. In my case it is 30T. (Yes, it is test env :) )

Screenshots
image
image

Windows Server (please complete the following information):

  • OS Version: Windows Server 2019 Datacenter 10.0

SQL Server (please complete the following information):

  • SQL Version: SQL Server 2016 (SP3-CU1-GDR) (KB5015371) - 13.0.7016.1 (X64)
  • SQL Edition: Developer Edition

SQL Server Management Studio (SSMS -> about -> copy info):
SQL Server Management Studio 15.0.18410.0
SQL Server Management Objects (SMO) 16.100.47008.0+9f71e8549924d85d66afcca2b9f45a33061faa1b
Microsoft Analysis Services Client Tools 15.0.19750.0
Microsoft Data Access Components (MDAC) 10.0.20348.1
Microsoft MSXML 3.0 6.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.20348

SQLWATCH version (from DACPAC or from sysinstances)

  • 4.3.0.0
@marcingminski
Copy link
Owner

Hi, Can you help me fix this? I don't have 30TB db in my test setup :). What do you think the problem is?

@kekcjkee
Copy link
Contributor Author

Hi, Can you help me fix this? I don't have 30TB db in my test setup :). What do you think the problem is?

Hi, I recently left a company where I managed a 30TB database. Initially, I thought that sp_spaceused utilized an int variable, but that turned out to be incorrect. I'm not sure why it doesn't work.

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

No branches or pull requests

2 participants