Get Hostname from FQDN

When working with a view or table, there may a need to extract the hostname from a fully qualified domain name (FQDN) column value. Below is a case statement that can be used to obtain the hostname. The CHARINDEX(‘.’, FQDN) > 0 expression returns the position of the first period. If not found, it will…