Dedicated SQL Pool In Azure - Cannot use System Views to calculate size for tables
0
votes
1
answer
976
views
I know that it's a repeated question but I've tried all solution and workaround suggested from every possible question present on stackoverflow.com I have inherited a dedicated SQL Pool with a SQL Server version 2012.0.2000.8 on which there are several tables.
We're looking to understand how much retention should we set and to do that we're analyzing the size of every table. I've tried - https://dba.stackexchange.com/questions/112167/show-data-and-disk-use-breakdown-by-table/112194#112194 - https://dba.stackexchange.com/questions/84333/space-usage-on-sys-allocation-units-and-sp-spaceused?noredirect=1&lq=1 - Generating report by clicking on the right of database, but I don't have that option in SSMS Tried to write this query SELECT OBJECT_SCHEMA_NAME(p.object_id) + '.' + OBJECT_NAME(p.object_id) AS TableName, SUM(p.rows) AS RowCounts, CONVERT(DECIMAL,SUM(p.reserved_page_count)) * 8 / 1024 AS TotalSpaceMB, CONVERT(DECIMAL,SUM(p.used_page_count)) * 8 / 1024 AS UsedSpaceMB , CONVERT(DECIMAL,SUM(p.reserved_page_count - p.used_page_count)) * 8 / 1024 AS UnusedSpaceMB FROM sys.partitions p WHERE p.index_id 255 GROUP BY t.Name, s.Name, p.Rows ORDER BY UsedSpaceGB DESC, t.Name Everytime there is a use of Sys Views (sys.schemas / sys.partition / sys.allocation_units etc. etc.) it says
**Catalog view 'X' is not supported in this version.** I think that mostly there could be a problem with some permission since I cannot use system views and they should be present in my version of SQL Pool.
So, my question is,

Asked by Fedeco
(103 rep)
Mar 15, 2023, 11:11 AM
Last activity: Mar 15, 2023, 12:17 PM
Last activity: Mar 15, 2023, 12:17 PM