I am trying to delete some old tags that reference clients no longer in our environment and the delete fails with: A tag you have attempted to remove is in use in: Variable sets. I have go through all our variable sets and confirmed that these tags are no longer used (although they may have existed in old deployments that have not yet been deleted). Is there a way to force these to be deleted?
I have poked through the DB and noticed all the tag sets exist in dbo.TagSet and each tag set has the tags in a JSON column. I added line breaks to make reading it easier.
{“Description”:"",“Tags”:[
{“Id”:“TagSets-3/Tags-1”,“Name”:“QA-SQL05”,“Description”:null,“Color”:"#ECAD3F",“SortOrder”:0},
{“Id”:“TagSets-3/Tags-2”,“Name”:“QA-SQL06”,“Description”:null,“Color”:"#A77B22",“SortOrder”:1},
{“Id”:“TagSets-3/Tags-25”,“Name”:“B-QA”,“Description”:“Uses B Database”,“Color”:"#6e6e6e",“SortOrder”:2},
{“Id”:“TagSets-3/Tags-122”,“Name”:“H-QA”,“Description”:“Uses H DB”,“Color”:"#6e6e6e",“SortOrder”:3},
{“Id”:“TagSets-3/Tags-26”,“Name”:“P-QA”,“Description”:“Uses P Database”,“Color”:"#6e6e6e",“SortOrder”:4},
{“Id”:“TagSets-3/Tags-62”,“Name”:“QA-SQL08”,“Description”:null,“Color”:"#983230",“SortOrder”:5},
{“Id”:“TagSets-3/Tags-141”,“Name”:“QA-SQL10”,“Description”:null,“Color”:"#3156B3",“SortOrder”:0},
{“Id”:“TagSets-3/Tags-142”,“Name”:“QA-SQL11”,“Description”:null,“Color”:"#203A88",“SortOrder”:0}
]}
I’d like to delete from the JSON column:
{“Id”:“TagSets-3/Tags-25”,“Name”:“B-QA”,“Description”:“Uses B Database”,“Color”:"#6e6e6e",“SortOrder”:2},
{“Id”:“TagSets-3/Tags-122”,“Name”:“H-QA”,“Description”:“Uses H DB”,“Color”:"#6e6e6e",“SortOrder”:3},
{“Id”:“TagSets-3/Tags-26”,“Name”:“P-QA”,“Description”:“Uses P Database”,“Color”:"#6e6e6e",“SortOrder”:4},
I assume this will achieve what I am trying to accomplish (remove the tags B-QA, H-QA and P-QA). What I don’t know is if this info persists anywhere else, or if there is a cleaner way to achieve what I am trying to do.