Posted by Dan Guzman on 03/07/06 14:48
Try:
UPDATE MyTable
SET ImagePath = '\Images\' + ImagePath
This can be encapsulated in a stored procedure if needed:
CREATE PROC dbo.UpdateImagePath
@ImagePathPrefix varchar(255)
AS
UPDATE MyTable
SET ImagePath = @ImagePathPrefix + ImagePath
GO
EXEC dbo.UpdateImagePath '\Images\'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Shwetabh" <shwetabhgoel@gmail.com> wrote in message
news:1141734360.018259.125170@i40g2000cwc.googlegroups.com...
> Hi,
>
> I want to change the data in a few fields of a table.
> There are many records (about 1k+). All I want to do to
> these fields is to append a string to the starting of data in the
> fields.
> eg:
>
> Old Data ->
>
> ---------------------------
> Image
> ---------------------------
> A1.jpg
> A2.jpg
>
>
>
> Required data ->
>
>
> -----------------------------
> Image
> ----------------------------
> \Images\A1.jpg
> \Images\A2.jpg
>
>
>
>
>
> For this purpose, should I use a procedure or is there any other
> possible way out?
>
> Awaiting your replies,
> Regards
> Shwetabh
>
[Back to original message]
|