SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Update Trigger on a file path column update?
 New Topic  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

3865 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000