<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help with SQL query in Server Management - Systems Insight Manager</title>
    <link>https://community.hpe.com/t5/server-management-systems/need-help-with-sql-query/m-p/6914120#M61146</link>
    <description>&lt;P&gt;I have a report that's run daily and is used to keep an inventory list updated. I'm tying to add hyperlinks in the inventory that will link directly to the device pages of our servers in HP SIM. The url of the page is https://server:port/mxportal/DevicePage/devicepage.jsp?nodeId=&amp;lt;MxGUID&amp;gt;.&lt;/P&gt;&lt;P&gt;I thought I'd be able to just include the MxGuid in the report but it doesn't look like this value can be included in a report. My next thought was to modify the SQL query that generates the report. The only problem - I only know the most basic of T-SQL and haven't been able to figure it out. Any SQL gurus out there that can modify the query below to include the MxGUID value from the dbo.devices table in the output?&lt;/P&gt;&lt;P&gt;select R_Inventory.DeviceName, R_Inventory.IPAddress, R_Inventory.DeviceStatus, R_Inventory.ProductName, R_Inventory.SerialNumber, R_Inventory.MemorySize, R_Inventory.OSName, R_Inventory.Location, R_Inventory.DeviceOwner, R_Inventory.DeviceBootTime, R_Inventory.numberOfCPU&lt;BR /&gt;from R_Inventory&lt;BR /&gt;WHERE ((R_Inventory.SnapShotID=-1) OR (R_Inventory.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices&lt;BR /&gt;LEFT OUTER JOIN DB_deviceInfoEx ON devices.deviceKey = DB_deviceInfoEx.deviceKey&lt;BR /&gt;LEFT OUTER JOIN IPAddress ON devices.deviceKey = IPAddress.deviceKey and IPAddress.ipIndex = 0&lt;BR /&gt;LEFT OUTER JOIN associated_device_data ON devices.deviceKey = associated_device_data.deviceKey&lt;BR /&gt;LEFT OUTER JOIN deviceProtocolInfo ON devices.deviceKey = deviceProtocolInfo.deviceKey&lt;BR /&gt;LEFT OUTER JOIN simAggrStatus ON devices.deviceKey = simAggrStatus.deviceKey&lt;BR /&gt;LEFT OUTER JOIN DeviceStatusValue ON devices.deviceKey = DeviceStatusValue.deviceKey and DeviceStatusValue.StatusSourceId= 6&lt;BR /&gt;JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '00000022649872840000000400000014'&lt;BR /&gt;WHERE ( ( devices.productType = 1) ) ) order by R_Inventory.DeviceName ASC&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2016 15:16:44 GMT</pubDate>
    <dc:creator>bbarz</dc:creator>
    <dc:date>2016-11-01T15:16:44Z</dc:date>
    <item>
      <title>Need help with SQL query</title>
      <link>https://community.hpe.com/t5/server-management-systems/need-help-with-sql-query/m-p/6914120#M61146</link>
      <description>&lt;P&gt;I have a report that's run daily and is used to keep an inventory list updated. I'm tying to add hyperlinks in the inventory that will link directly to the device pages of our servers in HP SIM. The url of the page is https://server:port/mxportal/DevicePage/devicepage.jsp?nodeId=&amp;lt;MxGUID&amp;gt;.&lt;/P&gt;&lt;P&gt;I thought I'd be able to just include the MxGuid in the report but it doesn't look like this value can be included in a report. My next thought was to modify the SQL query that generates the report. The only problem - I only know the most basic of T-SQL and haven't been able to figure it out. Any SQL gurus out there that can modify the query below to include the MxGUID value from the dbo.devices table in the output?&lt;/P&gt;&lt;P&gt;select R_Inventory.DeviceName, R_Inventory.IPAddress, R_Inventory.DeviceStatus, R_Inventory.ProductName, R_Inventory.SerialNumber, R_Inventory.MemorySize, R_Inventory.OSName, R_Inventory.Location, R_Inventory.DeviceOwner, R_Inventory.DeviceBootTime, R_Inventory.numberOfCPU&lt;BR /&gt;from R_Inventory&lt;BR /&gt;WHERE ((R_Inventory.SnapShotID=-1) OR (R_Inventory.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices&lt;BR /&gt;LEFT OUTER JOIN DB_deviceInfoEx ON devices.deviceKey = DB_deviceInfoEx.deviceKey&lt;BR /&gt;LEFT OUTER JOIN IPAddress ON devices.deviceKey = IPAddress.deviceKey and IPAddress.ipIndex = 0&lt;BR /&gt;LEFT OUTER JOIN associated_device_data ON devices.deviceKey = associated_device_data.deviceKey&lt;BR /&gt;LEFT OUTER JOIN deviceProtocolInfo ON devices.deviceKey = deviceProtocolInfo.deviceKey&lt;BR /&gt;LEFT OUTER JOIN simAggrStatus ON devices.deviceKey = simAggrStatus.deviceKey&lt;BR /&gt;LEFT OUTER JOIN DeviceStatusValue ON devices.deviceKey = DeviceStatusValue.deviceKey and DeviceStatusValue.StatusSourceId= 6&lt;BR /&gt;JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '00000022649872840000000400000014'&lt;BR /&gt;WHERE ( ( devices.productType = 1) ) ) order by R_Inventory.DeviceName ASC&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 15:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/need-help-with-sql-query/m-p/6914120#M61146</guid>
      <dc:creator>bbarz</dc:creator>
      <dc:date>2016-11-01T15:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SQL query</title>
      <link>https://community.hpe.com/t5/server-management-systems/need-help-with-sql-query/m-p/6915852#M61164</link>
      <description>&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;If you can figure out the table/column that holds the MxGUID, you can do something like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;...R_Inventory&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;numberOfCPU&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#ff0000" face="Consolas" size="2"&gt;'https://yoursimserver:50000/mxportal/DevicePage/devicepage.jsp?nodeId='&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;+&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; MxGUIDColumnName &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; SMHPage&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;But it might be easier to just go directly the SMH URL if you can't figure out the MxGUID field:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;...&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;R_Inventory&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;numberOfCPU&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#ff0000" face="Consolas" size="2"&gt;'https://'&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;+&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; R_Inventory&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;DeviceName &lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;+&lt;/FONT&gt; &lt;FONT color="#ff0000" face="Consolas" size="2"&gt;':2381'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; SMHPage&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;NK&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:41:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/need-help-with-sql-query/m-p/6915852#M61164</guid>
      <dc:creator>NJK-Work</dc:creator>
      <dc:date>2016-11-08T15:41:41Z</dc:date>
    </item>
  </channel>
</rss>

