December 4, 2008 at 9:11 pm
I have a need to update part of a column that has a production UNC path to a specific directory file and need to replace it to a test directory path instead
Table Template_Dir has Column (Template_Path) with "\\SERVER1\Reports\%inc\%report\" value
I need to just replace \\SERVER1\Reports with "\\NEWSERVER\Reports\%inc\%report\" on any occurence that has \\SERVER1\Reports in the Template_Path Column
I figured its like UPDATE Template_Dir SET Template_Path = '\\NEWSERVER\Reports\???' WHERE Dept = 'HR'
I need to maintain the current UNC path after \\NEWSERVER\Reports\ (\%inc\%report) and just change \\SERVER1\Reports\ part of the whole UNC path
Appreciate help on this newbie update.
December 4, 2008 at 9:28 pm
Peter D (12/4/2008)
I have a need to update part of a column that has a production UNC path to a specific directory file and need to replace it to a test directory path insteadTable Template_Dir has Column (Template_Path) with "\\SERVER1\Reports\%inc\%report\" value
I need to just replace \\SERVER1\Reports with "\\NEWSERVER\Reports\%inc\%report\" on any occurence that has \\SERVER1\Reports in the Template_Path Column
I figured its like UPDATE Template_Dir SET Template_Path = '\\NEWSERVER\Reports\???' WHERE Dept = 'HR'
I need to maintain the current UNC path after \\NEWSERVER\Reports\ (\%inc\%report) and just change \\SERVER1\Reports\ part of the whole UNC path
Appreciate help on this newbie update.
u can use this
update tablename set value = Replace('\\SERVER1\Reports\%inc\%report\,'SERVER1','NEWSERVER') where condition
kshitij kumar
kshitij@krayknot.com
www.krayknot.com
December 4, 2008 at 10:17 pm
Like this:
UPDATE Template_Dir
SET Template_Path = Replace(Template_Path, '\\SERVER1\Reports', '\\NEWSERVER\Reports\')
WHERE Dept = 'HR'
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 5, 2008 at 7:29 am
Great thnxs guys for your help.
December 5, 2008 at 6:40 pm
Glad we could help
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 6, 2008 at 4:41 pm
Stuff like that shouldn't be hardcoded. It should be in a configuration table.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply