Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20625

Re: Is there a way to mass edit OUT FQDN?

$
0
0

SQL version I use to strip ANY domain from nodes.

 

This will show you all nodes which have periods and what they would be changed to if you ran the second script.

SELECT nodeid,Caption AS [Before] ,CASE WHEN caption LIKE '%.%' THEN LEFT(Caption, CHARINDEX('.', Caption) - 1) ELSE Caption END AS [After]

FROM [Orion].[dbo].[Nodes]

WHERE Caption like '%.%'

 

 

Second script to make the change

UPDATE [Orion].[dbo].[Nodes]

SET Caption = (CASE WHEN caption LIKE '%.%' THEN LEFT(Caption, CHARINDEX('.', Caption) - 1) ELSE Caption END)

WHERE caption like '%.%'


Viewing all articles
Browse latest Browse all 20625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>