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.
| Author |
Topic |
|
lgarcia3
Starting Member
15 Posts |
Posted - 2006-03-03 : 11:52:58
|
| I'd like to use the "instead of" command so I can have access to a "Text" field during an update. Now, the table where I have to do this already have an Update trigger. If I understand well the Instead command will overwrite any update trigger already there. So, how do I do to run the old triggers and mine as well? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-03-03 : 14:06:05
|
| >>"instead of" command I assume you are talking about an additional trigger of type: INSTEAD OF UPDATE ?>>so I can have access to a "Text" field during an updateIs this so that you can access the text value before the update occurs? If not:in the existing AFTER UPDATE trigger, if you join inserted (or deleted) table to the table with the trigger you will "have access" to the updated value (from the actual table) just not the old value from the deleted table.If you can't change the column from text to some flavor of varchar, and you need to know the pre-updated text value then I would suggest one of 2 things. Either perform this logic in your UPDATE SP (preferred), or move the existing trigger logic to a new instead of trigger. Just don't forget to perform the actual (user) update if you go with the INSTEAD OF UPDATE trigger.Be One with the OptimizerTG |
 |
|
|
Kristen
Test
22859 Posts |
|
|
|
|
|