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)
 Update Trigger on a file path column update?

Author  Topic 

akpaga
Constraint Violating Yak Guru

331 Posts

Posted - 2013-02-28 : 16:53:17
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-28 : 18:27:03
[code]UPDATE Customers SET path = REPLACE(path,'Regular','Daily');[/code]
Go to Top of Page
   

- Advertisement -