﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Development  / Remove set of characters between [abcd] in a variable / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 07:59:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Remove set of characters between [abcd] in a variable</title><link>http://www.sqlservercentral.com/Forums/Topic944345-145-1.aspx</link><description>My 2 cents :-)[code="sql"]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) &amp;gt; 0 then right (string, (len(string)- charindex(']',string)))                else string         end finalstringfrom @table[/code]</description><pubDate>Mon, 28 Jun 2010 22:59:50 GMT</pubDate><dc:creator>ColdCoffee</dc:creator></item><item><title>RE: Remove set of characters between [abcd] in a variable</title><link>http://www.sqlservercentral.com/Forums/Topic944345-145-1.aspx</link><description>How does this work?[code="sql"]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) &amp;gt; 0 then substring(Col1, Charindex(']', Col1)+2, 50)       else Col1 end  from @test[/code]</description><pubDate>Mon, 28 Jun 2010 22:13:15 GMT</pubDate><dc:creator>WayneS</dc:creator></item><item><title>Remove set of characters between [abcd] in a variable</title><link>http://www.sqlservercentral.com/Forums/Topic944345-145-1.aspx</link><description>I have a SP which gets parameter @business like this[abcdef] Client[gdhdnuidd] 1st Party SWtestbusinessI want to get rid of the charcters from [ and ]. Is there a SQL function which searches for the open bracket[ and closing bracket ] and remove the whole set of characters.Is it possible. Appreciate your help on this,.The end result i want should be like thisClient1st Party SWtestbusinessBasically i want to remove the characters inside the brackets and the bracket too..--Sam</description><pubDate>Mon, 28 Jun 2010 19:13:59 GMT</pubDate><dc:creator>sammm</dc:creator></item></channel></rss>