declare @test table (Col1 varchar(50))insert into @testselect '[abcdef] Client' UNION ALLselect '[gdhdnuidd] 1st Party SW' UNION ALLselect 'testbusiness' select case when charindex(']', Col1) > 0 then substring(Col1, Charindex(']', Col1)+2, 50) else Col1 end from @test
declare @table table(string varchar(50))insert @table (string)select '[gdhdnuidd] 1st Party SW'union all select '[abcdef] Client'union all select 'testbusiness'select case when charindex(']',string) > 0 then right (string, (len(string)- charindex(']',string))) else string end finalstringfrom @table