Where is it you're trying to edit? Node Name?
Yep. It pulled in 200 routers that are all similarly named : routerlocation.something.blah.com
The alerts and maps look terrible with something.blah.com attached to them and I'm trying to remove it from the node name.
Are you familiar with the concatenate process in excel? And just to note, I've blasted out hundreds of nodes at a time updating several different custom properties assigned to nodes, and node names etc - it works great for bulk stuff!!
You could do a spreadsheet to update the nodes table like this:
Column F is where you put the concatenate function, to concatenate columns a-e and should look like this: =CONCATENATE(A1;B1;C1;D1;E1)
Then cut and paste column F into your favorite editor, I used notepad++ and replace the "SetCaption" with "Set Caption" and replace ?s with ' s, and finally copy and paste as a query into your sql db (This is assuming you want the Caption field changed, you can update whatever field you want by just changing caption to whatever obviously) -
After above mentioned replaces and what needs to be copied to SQL -
Shout out to amstephen87 for showing this to me!
I use the SQL REPLACE command to do this exact thing all of the time. I usually do it right from the Database Manager. Here is the syntax I use:
set caption = replace(caption,'.yourdomain.com','')
In this case, you would, of course, replace the .yourdomain.com with the actual domain name you are trying to remove. What this command does is replaces the domain name string (including the leading period) with an empty string.
Hope that helps.
This was helpful. Simplified the updates I had to do to strip domain names from several hundred nodes. Thanks for sharing this.
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]
WHERE Caption like '%.%'
Second script to make the change
SET Caption = (CASE WHEN caption LIKE '%.%' THEN LEFT(Caption, CHARINDEX('.', Caption) - 1) ELSE Caption END)
WHERE caption like '%.%'