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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Update Certain Data in a column

Author  Topic 

Limuh
Yak Posting Veteran

94 Posts

Posted - 2011-05-18 : 23:35:32
Hi,

Is there any way to update a data having the same values.

For example

Column A
-------
I:\Test\2107_Boom\AccentureNGA\xslt\Letter1.xslt
I:\Test\2107_Boom\AccentureNGA\xslt\Letter2.xslt
I:\Test\2107_Boom\AccentureNGA\xslt\Letter3.xslt

I want to update the record that having I:\Test\ to D:\Testing is there any way that i can do it on one update statement aside from doing the update per record?

Thank you for the help.

nathans
Aged Yak Warrior

938 Posts

Posted - 2011-05-19 : 00:07:30
update t
set ColumnA = replace(ColumnA, 'I:\Test\', 'D:\Testing\') -- assume you want trailing slash there
from YourTable as [t]
--where ColumnA like 'I:\Test\%' --?
Go to Top of Page

Limuh
Yak Posting Veteran

94 Posts

Posted - 2011-05-19 : 01:47:31
Thank you nathans, this is very helpful..
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2011-05-19 : 12:12:28
anytime.
Go to Top of Page
   

- Advertisement -