Link to home
Start Free TrialLog in
Avatar of BrookK
BrookK

asked on

Replace a string

I have to update a table with the replace function. The table test has a column text.
This column has string 'Invalid ISBN {11111,222,333}'. I have to replace the string in { and } braces with the new variable value.
update test
set text = 'Invalid ISBN { ' + @ISBNlist + ' }'
where !ID = @id.
 
Can anyone tell me how to use replace in the above update statement?
 
Thanks,
-B

Open in new window

Avatar of Aneesh
Aneesh
Flag of Canada image

if it is of the same struture you can overwrite the field

update test
set text = 'Invalid ISBN { ' + @ISBNlist + ' }'
where ID = @id
ASKER CERTIFIED SOLUTION
Avatar of pssandhu
pssandhu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BrookK
BrookK

ASKER

Thanks guys. I implemented Aneesh's suggestion but Pssandhu's suggestion worked well too.

-B
.......and you accepted the other solution
:)