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 |
|
EarlXT
Starting Member
10 Posts |
Posted - 2009-07-07 : 10:47:06
|
| I am creating a trigger that must be applyed to all my tables and I would like to get the Table Name form within the trigger so I don't have to type it in for every trigger. Is there a way to do this without manually supplying any information to the trigger? If I can even get the trigger name, I can extract the table name from that. Thanks for your helpEarlEarlXT |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2009-07-07 : 11:20:53
|
| what are you actually trying to carry out with this |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 12:45:13
|
| dont think there's a direct way of doing this |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-07-08 : 13:25:26
|
| I've never tried this myself (that's what code generators are for). But, there are a bunch of Metadata Functions (search for that in BOL).You might be able to get the name using a combination of Metadata functions like OBJECT_NAME() and @@ProcID. @@ProcID will return the ID of a stored procedure, user-defined function, or trigger. |
 |
|
|
|
|
|