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 |
|
Babli
Yak Posting Veteran
53 Posts |
Posted - 2007-05-16 : 06:19:22
|
| I have a table called Flag in which there are values for the column FlagImage as United KingdomCosta RicaI want to replace the space by %20 so that i getUnited%20KingdomCosta%20RicaI used the below query but got an error "Sub query returned more than 1 value.This is not permitted when the subquery follows..."Update Flag set FlagImage = replace(FlagImage,' ','%20')How shall I update the column FlagImage in a single query |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-05-16 : 06:53:33
|
| Do you have a trigger on the table? That doesn't look like an error that could come from that statement.I would consider leaving the value as it is and change it when it is extracted.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-16 : 06:54:11
|
| [code]declare @t table (flag varchar(100))insert into @t select 'United Kingdom' union allselect 'Costa Rica'Select flag from @tupdate @tset flag=replace(flag,' ','%20')Select flag from @t[/code]MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-16 : 06:55:06
|
your query looks fine to me.update Flagset FlagImage = replace(FlagImage, ' ', '%20') Are you sure you are posting the entire query here ? KH |
 |
|
|
Babli
Yak Posting Veteran
53 Posts |
Posted - 2007-05-16 : 07:38:27
|
There is no trigger associated with the table nor there is any constratint.I am replace the space with %20 while extracting the data.Thanks to the above idea.quote: Originally posted by khtan your query looks fine to me.update Flagset FlagImage = replace(FlagImage, ' ', '%20') Are you sure you are posting the entire query here ? KH
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-16 : 11:04:45
|
| So, did you get the problem solved?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|