select * from tb_Application select * from tb_Application whereEnabled = 1 select * from tb_Application whereEnabled = 0 Advertisements

Select opsys.applicationref, SYS.PackageID, OPSYS.ApplicationId, OPSYS.DisplayName,opsys.Enabled, OPSYS.SMSInstallProgram, OP.ApplicationGroupID, AG.GroupName,opsys.Comment from tb_Application OPSYS join tb_SMSProgram SYS on SYS.SMSProgramID=OPSYS.SMSInstallProgram join tb_Applications_ApplicationGroups OP on OPSYS.ApplicationID=OP.ApplicationID join tb_ApplicationGroup AG on OP.ApplicationGroupID=AG.ApplicationGroupID 

select  usr.FullName,mac.MachineName,mac.DomainName,mac.IPAddress,app.DisplayName,comp.RequestedTimestamp,comp.DateInstalled,  DeliveryStatus = CASE comp.DeliveryStatus            WHEN ‘1’ THEN ‘Completed’         WHEN ‘2’ THEN ‘Failed’         WHEN ‘3’ THEN ‘Pending’         WHEN ” THEN ‘Unknown’ END from tb_CompletedOrder comp join tb_Machine mac on comp.MachineId=mac.MachineId join tb_User usr on comp.UserId=usr.UserId join tb_Application app on comp.ApplicationId = app.ApplicationId where  mac.IPAddress in (‘10.0.0.0’)

select  usr.FullName,mac.MachineName,mac.DomainName,mac.IPAddress,app.DisplayName,comp.RequestedTimestamp,comp.DateInstalled,  DeliveryStatus = CASE comp.DeliveryStatus            WHEN ‘1’ THEN ‘Completed’         WHEN ‘2’ THEN ‘Failed’         WHEN ‘3’ THEN ‘Pending’         WHEN ” THEN ‘Unknown’ END from tb_CompletedOrder comp join tb_Machine mac on comp.MachineId=mac.MachineId join tb_User usr on comp.UserId=usr.UserId join tb_Application app on comp.ApplicationId = app.ApplicationId where MachineName like ‘%ABC123%’

delete from tb_Machine where MachineName=‘XXXX’

select usr.FullName,mac.MachineName,mac.DomainName,mac.IPAddress,app.DisplayName,comp.RequestedTimestamp,comp.DateInstalled, DeliveryStatus = CASE comp.DeliveryStatus            WHEN ‘1’ THEN ‘Completed’         WHEN ‘2’ THEN ‘Failed’         WHEN ‘3’ THEN ‘Pending’         WHEN ” THEN ‘Unknown’ END from tb_CompletedOrder comp join tb_Machine mac on comp.MachineId=mac.MachineId join tb_User usr on comp.UserId=usr.UserId join tb_Application app on comp.ApplicationId = app.ApplicationId where comp.DeliveryStatus =’2′ and RequestedTimestamp > ‘2014-01-30 00:00:00.700’