Larry Brister
asked on
SQL Server replace between tags
I have a table with a lot of place holders that are identified with brackets
There can be 1 - nnn instances.
Example
[FirstName] [LastName] is going on a vacation on [ReservationDate]
I need to make the text within the brackets all upper case
Example
[FIRSTNAME] [LASTNAME] is going on a vacation on [RESERVATIONDATE]
There can be 1 - nnn instances.
Example
[FirstName] [LastName] is going on a vacation on [ReservationDate]
I need to make the text within the brackets all upper case
Example
[FIRSTNAME] [LASTNAME] is going on a vacation on [RESERVATIONDATE]
And to followup, if you want to get rid of the square brackets afterwards, using replace would do that:
select @sentence = replace(replace(@sentence, '[', ''), ']', '')
ASKER
Lee
I need to read between the brackets without and specific text replace.
I need to read between the brackets without and specific text replace.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if this is an one time job, is that possible to create a mapping table?
try store those values within brackets into this mapping tables and indicate their correspondent replaced values.
and then just do a loop of Update SQL statements to update the values.
else some regular expression solutions could be the way to go...
try store those values within brackets into this mapping tables and indicate their correspondent replaced values.
and then just do a loop of Update SQL statements to update the values.
else some regular expression solutions could be the way to go...
ASKER
Beautiful
Thanks
Thanks
Open in new window