I need to remove all brackets and their contents from multiple records but I can’t figure out the best way to do this.
I would like to be able to write something like
SELECT dbo.RemoveBracketedText(ColumnName) FROM TableName;
And it would convert a record such as ‘Hello (World)’ to just ‘Hello ‘
Any help is appreciated.
Thanks!
My first approach would probably have been to write a quick c# app to do it or use SSIS and write a package to take care of it, but if your determined to use tsql… it will likely require a combination of a recursive function and some string manipulation.
This is minimally tested but should be close. (i.e. it worked on the sample text you provide in your question).