Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Update Trigger on a file path column update?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

331 Posts

Posted - 02/28/2013 :  16:53:17  Show Profile  Reply with Quote
Hi friends I have table where i save the path of folders and their subfolders of an application is the following way"

Table name:Customers

FolderID Folder ProjectID ParentID Path
1 Regular 20 0 Null
2 Texas 20 1(folder Id) Regular
3 Houston 20 2 Regular/Texas

So basically whenever i want to (update)change the folder name say Regular to Daily i would like to check for all the data in Path field and do the necessary change like shown below

FolderID Folder ProjectID ParentID Path
1 Daily 20 0 Null
2 Texas 20 1(folder Id) Daily
3 Houston 20 2 Daily/Texas

How can i perform this task..Thank you in advance...

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 02/28/2013 :  18:27:03  Show Profile  Reply with Quote
UPDATE Customers SET path = REPLACE(path,'Regular','Daily');
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000