dbTalk Databases Forums  

Properties of DB in SQL 2008 SSMS - Arithmetic overflow

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Properties of DB in SQL 2008 SSMS - Arithmetic overflow in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sql411@nospam.com
 
Posts: n/a

Default Properties of DB in SQL 2008 SSMS - Arithmetic overflow - 01-27-2009 , 03:25 PM






When in SSMS, I right-click and goto properties I get:

Msg 8115, Level 16, State 2, Line 11
Arithmetic overflow error converting expression to data type int.

The query that is causing the error is:

DECLARE @is_policy_automation_enabled bit
SET @is_policy_automation_enabled = (
SELECT CONVERT(bit , current_value)
FROM
msdb.dbo.syspolicy_configuration
WHERE name = 'Enabled'
)



SELECT CAST(cast(g.name as varbinary(256)) AS sysname) AS [Name]
, g.data_space_id AS [ID]
, CAST(g.is_default AS bit) AS [IsDefault]
, g.is_read_only AS [ReadOnly]
/* overflow is from next column */
, CAST(ISNULL((
select sum(gs.size) * convert(float , 8)
from sys.database_files gs
where gs.data_space_id = g.data_space_id
) , 0) AS float) AS [Size]
, CAST(CASE WHEN 'FD' = g.type THEN 1
ELSE 0
END AS bit) AS [IsFileStream]
, case when 1 = @is_policy_automation_enabled
and exists ( select *
from msdb.dbo.syspolicy_system_health_state
where target_query_expression_with_id like
'Server' + '/Database\[@ID=' + convert(nvarchar(20) , dtb.database_id) + '\]'
+ '/FileGroup\[@ID=' + convert(nvarchar(20) , g.data_space_id) + '\]%' ESCAPE
'\' ) then 1
else 0
end AS [PolicyHealthState]
FROM master.sys.databases AS dtb
, sys.filegroups AS g
WHERE ( dtb.name = db_name() )
ORDER BY [Name] ASC



The database is 23.22 TB, so I think the casting to a bigint is required,
but this is internal SQL code generated from SSMS.


Anyone run into this and no of a workaround?


Thanks,
Robert

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Properties of DB in SQL 2008 SSMS - Arithmetic overflow - 01-27-2009 , 04:42 PM






sql411 (AT) nospam (DOT) com (sql411nospamcom (AT) discussions (DOT) microsoft.com) writes:
Quote:
When in SSMS, I right-click and goto properties I get:

Msg 8115, Level 16, State 2, Line 11
Arithmetic overflow error converting expression to data type int.

The query that is causing the error is:
...
/* overflow is from next column */
, CAST(ISNULL((
select sum(gs.size) * convert(float , 8)
from sys.database_files gs
where gs.data_space_id = g.data_space_id
) , 0) AS float) AS [Size]
, CAST(CASE WHEN 'FD' = g.type THEN 1
...

The database is 23.22 TB, so I think the casting to a bigint is required,
but this is internal SQL code generated from SSMS.
Great catch! It's difficult to think of other workarounds than silly
ones like "don't right-click there" or "make your database smaller".

However, what you absolutely should do is submit this on
http://connect.microsoft.com/sqlserver/feedback. That's the best
way to make Microsoft aware of this issue.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx



Reply With Quote
  #3  
Old   
sql411@nospam.com
 
Posts: n/a

Default Re: Properties of DB in SQL 2008 SSMS - Arithmetic overflow - 01-27-2009 , 05:03 PM



Erland, thanks for the suggestion to post to connect.microsoft.com.

I did and here is the link:

https://connect.microsoft.com/SQLSer...dbackID=406510

Thanks again,
Robert Towne



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.