Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hh1234
Starting Member
30 Posts |
Posted - 2011-10-17 : 16:02:52
|
| Hi, I am new to SQL and still struggle with basic syntax etc.... I have this SCCM SQL report that works.SELECT DISTINCT a.Name0 AS [Machine Name],b.SiteCode,c.FileVersion AS [IE Version],d.Operating_System_Name_and0,c.FilePathFROM v_GS_SoftwareFile c INNER JOINv_GS_SYSTEM a ON c.ResourceID = a.ResourceID INNER JOINv_R_System d ON a.ResourceID = d.ResourceID INNER JOINv_FullCollectionMembership b ON a.ResourceID = b.ResourceIDWHERE (c.FileName = 'iexplore.exe') AND (c.FileVersion like '6.%')ORDER BY a.Name0Then, from a different SCCM Report I saw this logic, that returns the Assigned SCCM Site CodeSys.AD_SITE_NAME0 as 'Location', dbo.v_RA_System_SMSAssignedSites.SMS_Assigned_Sites0INNER JOIN dbo.v_RA_System_SMSAssignedSites ON SYS.ResourceID = dbo.v_RA_System_SMSAssignedSites.ResourceIDNo matter what I try when I merge the two it fails. The SCCM report won't even close/compile. How do I add the SITE CODE information to my working code?Thank you. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 00:41:30
|
| the second query is not completefor example i cant see the from part also i feel some columns are missing Post the complete query and then we will help you out in merging------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
hh1234
Starting Member
30 Posts |
Posted - 2011-10-18 : 09:52:59
|
| Thanks. I guess my question is how do I add Site Code to the first part of my code? I need to have the first part get the site code and display it when run. Thanks. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 10:10:36
|
| [code]SELECT DISTINCT a.Name0 AS [Machine Name],b.SiteCode,c.FileVersion AS [IE Version],d.Operating_System_Name_and0,c.FilePath,dbo.v_RA_System_SMSAssignedSites.SMS_Assigned_Sites0FROM v_GS_SoftwareFile c INNER JOINv_GS_SYSTEM a ON c.ResourceID = a.ResourceID INNER JOINv_R_System d ON a.ResourceID = d.ResourceID INNER JOINv_FullCollectionMembership b ON a.ResourceID = b.ResourceIDINNER JOIN dbo.v_RA_System_SMSAssignedSites ON a.ResourceID = dbo.v_RA_System_SMSAssignedSites.ResourceIDWHERE (c.FileName = 'iexplore.exe') AND (c.FileVersion like '6.%')ORDER BY a.Name0[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
hh1234
Starting Member
30 Posts |
Posted - 2011-10-18 : 13:25:00
|
| Cool, that worked. thank you. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-19 : 04:31:14
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|