Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
safzal1212
Starting Member
11 Posts |
Posted - 2009-08-26 : 14:58:02
|
| I have a table with text field and that field have some large text data. In that field I want to search the whole data and replace some values with other values. What is the good way to do it? I suspect we have a system stored procedure to do that! |
|
|
DeepRedWill
Starting Member
4 Posts |
Posted - 2009-08-26 : 15:12:10
|
Hi there. Your solution depends partly on how much needs to change, but it's likely similar to this:UPDATE tableSET col_to_change = REPLACE(col_to_change, "bad_data", "good_data"); The REPLACE function is key, and can be nested ad infinitum. |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-08-26 : 15:16:22
|
quote: Originally posted by DeepRedWill Hi there. Your solution depends partly on how much needs to change, but it's likely similar to this:UPDATE tableSET col_to_change = REPLACE(col_to_change, "bad_data", "good_data"); The REPLACE function is key, and can be nested ad infinitum.
REPLACE doesn't work on TEXT data type |
 |
|
|
DeepRedWill
Starting Member
4 Posts |
Posted - 2009-08-26 : 15:23:05
|
| Right. I wasn't thinking data types at all, my bad. |
 |
|
|
|
|
|