This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Does anyone know how to add the the System Name to a SQL script?

I have a script that I ran and it has Name but when I export it to Exel it is a numeric value.

SELECT

UDT_UnUsedPorts.NodeID AS NodeID, 

UDT_UnUsedPorts.PortID AS PortID, 

UDT_UnUsedPorts.DNS AS DNS, 

UDT_UnUsedPorts.IP_Address AS IP_Address, 

UDT_UnUsedPorts.Name AS Name, 

UDT_UnUsedPorts.PortDescription AS Port_Description, 

UDT_UnUsedPorts.DaysUnused AS DaysUnused, 

UDT_Port.PortID AS PortID2, 

UDT_Port.AdministrativeStatus AS AdminStatus, 

UDT_Port.OperationalStatus AS OperStatus 

FROM UDT_UnUsedPorts 

INNER JOIN UDT_Port 

ON UDT_Port.PortID = UDT_UnUsedPorts.PortID    

WHERE 

  ISNUMERIC(UDT_UnUsedPorts.DaysUnused) = 1 

  AND CAST(UDT_UnUsedPorts.DaysUnused AS INT) >= 90 

  OR UDT_UnUsedPorts.DaysUnused = 'Never' 

AND UDT_Port.AdministrativeStatus = 1 

AND UDT_Port.OperationalStatus = 2