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.

Set Caption = stripped FQDN

We've had a SQL job for a long time now that does this job. I'd like to do this instead via SWQL, and not sure how to write it. Here is the SQL job. It basically forces Caption to equal the FQDN stripped down to the Hostname:

Update NodesData
SET Caption = LEFT(DNS, CHARINDEX('.', DNS) - 1)
WHERE CHARINDEX('.', DNS) > 0
AND Caption <> LEFT(DNS, CHARINDEX('.', DNS) - 1)

I know how to modify the Caption via SWQL, just not sure about the WHERE clause, which doesn't seem to work in SWQL Studio as is. Maybe that SQL syntax cannot be used exactly as is, and needs some tweaking.

Any help will be greatly appreciated.