• You can use a lot of methods to do this. It all depends on what part of the String you want to remove, the type of requirement(one time or a lot of times) and a lot more conditions. Apart from the abovew mentioned ways you can use Stuff and Replace as well as follows:

    Declare @String Varchar(Max) = 'BUILTIN\ADMINISTRATORS: [System Admin]YES;[Security Admin];[Server Admin];[setup Admin];[Process Admin];[Disk Admin]YES;[Database Creator]'

    Select STUFF(STUFF(@String, 42, 62, ''), 59, 18, '')

    Select Replace(REPLACE(@String, '[Security Admin];[Server Admin];[setup Admin];[Process Admin];', ''), '[Database Creator]', '')

    Now, you have a lot of options and you can choose the best depending on the conditions that define your requirement.

    Edit: The Stuff Function should give better performance. And I am sure when Dwain sees the Replace functions he would definitely come up with a couple of expert performance points. That would clear the situation a little more. 🙂

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉