sql server dts:
You should be able to use the REPLACE function. This select statement =
should show you that it works as expected:
SELECT REPLACE(MediaName, 'myServer.gunnery', 'newserver.gunnery') FROM =
YourTable
After verifying that the select gives you the expected result, run the =
following update to update the data within the table:
--UPDATE YourTable SET MediaName =3D REPLACE(MediaName, =
'myServer.gunnery', 'newserver.gunnery')=20
--SELECT @@rowcount AS RowsUpdated
--=20
Keith
=20
[quoted text, click to view] "bj daniels" <danielsb@gunnery.org> wrote in message =
news:eNjDE50ZDHA.1620@TK2MSFTNGP12.phx.gbl...
> I am not certain which group to post this to - sorry if this is the =
wrong
> group:
>=20
> I have a table that holds the location of various media and such =
(mostly
> images). One field is the Media name, the other is the URL in the =
form
>
http://myServer.gunnery.org/media/pic1 for example. we are about to =
move
> all the media to a new location (new server). the paths will remain =
the
> same except for the server name.
>=20
> Is there an update statement that will let me go through the table an
> replace myServer with newServer in all the URLs (and leave the rest of =
the
> URL alone). So the link above would become
>
http://newServer.gunnery.org/media/pic1. I know how I would do it =
with VB,
> but I am not as familar with all the tricks in SQL.
>=20
> thanks
>=20
> bj daniels
> danielsb@gunnery.org
>=20
I am not certain which group to post this to - sorry if this is the wrong
group:
I have a table that holds the location of various media and such (mostly
images). One field is the Media name, the other is the URL in the form
http://myServer.gunnery.org/media/pic1 for example. we are about to move
all the media to a new location (new server). the paths will remain the
same except for the server name.
Is there an update statement that will let me go through the table an
replace myServer with newServer in all the URLs (and leave the rest of the
URL alone). So the link above would become
http://newServer.gunnery.org/media/pic1. I know how I would do it with VB,
but I am not as familar with all the tricks in SQL.
thanks
bj daniels
danielsb@gunnery.org