E9.2 JDE tablee size

mancher

Member
Hey all,
am pretty new this JDE, and I want to calculate the size of a table in JDE, I have this linked server pointing to JDE database on SSMS, so, is there any query to perform this action?
I had tried different query from online, but nothing worked out.
Hope someone could help me.
Thank you.
 
I am regularly using #1 and #2 from this post:
These can't be used on the tables that resides on JDE server, in SSMS we are just creating the linked server connection which stores on the metadata of the jade tables.
 
These can't be used on the tables that resides on JDE server, in SSMS we are just creating the linked server connection which stores on the metadata of the jade tables.
See? This is what happens if you don‘t give enough or any info. I am not sure if or how that can work via linked server. If this is a one time thing you could pull the whole table over and check on the local server then.
 
To calculate the size of a table in JDE, you can use the following query in SQL Server Management Studio (SSMS):
SELECT
t.NAME AS TableName,
p.rows AS RowCounts,
CAST(SUM(a.total_pages) * 8 / 1024 AS DECIMAL(10,2)) AS TotalSpaceMB,
CAST(SUM(a.used_pages) * 8 / 1024 AS DECIMAL(10,2)) AS UsedSpaceMB,
CAST((SUM(a.total_pages) - SUM(a.used_pages)) * 8 / 1024 AS DECIMAL(10,2)) AS UnusedSpaceMB
FROM
JDE_DATABASE_NAME.sys.tables t
INNER JOIN
JDE_DATABASE_NAME.sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
JDE_DATABASE_NAME.sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
JDE_DATABASE_NAME.sys.allocation_units a ON p.partition_id = a.container_id
WHERE
t.NAME = 'YOUR_TABLE_NAME'
GROUP BY
t.NAME, p.Rows
ORDER BY
t.NAME

Make sure to replace "JDE_DATABASE_NAME" with the actual name of your JDE database and "YOUR_TABLE_NAME" with the name of the table you want to calculate the size for.

This query should give you the total size of the table in MB, as well as the used and unused space. I hope this helps!
 
Back
Top