Friday, October 27, 2006

SMS SQL to show AD Sites for your Distribution Points

Shows you AD Sites for your Distribution Points.

----Begin SQL----
Select SiteCode 'SMS Site', name0 'Name', AD_Site_Name0 'Servers Physical AD Site', IP_Addresses0 'Servers IP' from dbo.v_R_Systemjoin v_SystemResourceListon name0 = servernameleft outer join dbo.v_RA_System_IPAddresseson v_R_System.resourceid=v_RA_System_IPAddresses.resourceidwhere RoleName = 'SMS Distribution Point'
order by SiteCode, name0 desc
----End SQL----

Wednesday, October 4, 2006

SMS SQL to See the Size of a Table

The following will show you the size of your software inventory table. Change the table name to view other table sizes. Replace yourSMSdbName with the name of your SMS database.

----Begin SQL----

EXEC sp_spaceused N'yourSMSdbName.dbo.SoftwareInventory';

----End SQL----