This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t.NAME AS TableName, | |
p.rows AS RowCounts, | |
(SUM(a.total_pages) * 8) / 1024 AS TotalSpaceMB, | |
(SUM(a.used_pages) * 8) / 1024 AS UsedSpaceMB, | |
((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024 AS UnusedSpaceKB | |
FROM | |
sys.tables t | |
INNER JOIN | |
sys.indexes i ON t.OBJECT_ID = i.object_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @cols NVARCHAR(max), @ContentTypeId int | |
SET @ContentTypeId = 1074 | |
SELECT @cols = STUFF(( | |
SELECT DISTINCT TOP 100 PERCENT | |
'],[' | |
+ CONVERT(varchar, Name + ' (' + CONVERT(varchar, id) + ')', 255) | |
FROM | |
dbo.cmsPropertyType | |
WHERE |