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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 query to change file path text in db

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2009-08-19 : 14:55:00
hi

filepaths are stored in database table like
for orderno=11
..locA/a.tif
..locA/b.tif
..
..
...locA/z.tif


now bcoz of some reasons
files in between has been changed as follows
...
....
locB/c.tif --hear it should be locA/c.tif


hear r lot of such entried

can any sql query help to resolve prob

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-08-19 : 15:01:49
You need to provide more information than that.

What is the table structure..and what specific records you want to update...

ANy...you might want to check out the REPLACE function..

something

replace(filepaths,'locB','locA')
Go to Top of Page

Swati Jain
Posting Yak Master

139 Posts

Posted - 2009-08-19 : 20:08:05
quote:
Originally posted by vijayisonly

You need to provide more information than that.

What is the table structure..and what specific records you want to update...

ANy...you might want to check out the REPLACE function..

something

replace(filepaths,'locB','locA')




not only locB-->locA
their is change in name of tif files also
suppose folder 'locA' is having tif files
locA
a.tif
b.tif
c.tif

locB
a1.tif
s1.tif
d1.tif

so in db table filepaths are stored for order no=11
locA/a.tif
locB/s1.tif --->but it should be locA/b.tif

tablestructure
id filepath orderno


how this can be replaced quickly?
Go to Top of Page
   

- Advertisement -