|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Properties of DB in SQL 2008 SSMS - Arithmetic overflowMsg 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 sql411@nospam.com (sql411nospamcom@discussions.microsoft.com) writes:
Show quoteHide quote > When in SSMS, I right-click and goto properties I get: Great catch! It's difficult to think of other workarounds than silly> > 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. 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, esq***@sommarskog.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/prodinfo/previousversions/books.mspx
Other interesting topics
Maintainance Plans Disappeared from SSMS
sql profiler writing on an unused partition? SQL Maintenance Plans and Atomic Backups of a Set of Databases Need help debugging this... SQL Management Studio and Small Business Server SQL Server 2005 Database Tuning Advisor DTE recommends an index that already exists but with a different . Help with SQL Profiler automatic bak filename generation Calling sqlcmd in a loop? |
|||||||||||||||||||||||