|
If each row of records contains only one <Cmd> ... </ Cmd>:
declare @ str1 varchar (100), @ str2 varchar (20)
set @ str1 = '<Aes> <Cmd> MAReport </ Cmd> <Preview> false </ Preview> </ Aes>'
set @ str2 = 'testString'
select stuff (@ str1, charindex ('<Cmd>', @ str1) + 5, charindex ('</ Cmd>', @ str1) -charindex ('<Cmd>', @ str1) -5, @ str2) |
|