You could use the SET CONTEXT_INFO command to store the SP name in a connection wide context and then retrieve it from the trigger using a query on sysprocesses or CONTEXT_INFO() built-in in SQL Server 2005. See BOL on SET CONTEXT_INFO for more details. This will allow you to perform the check without modifying the schema. If you are on older versions of SQL Server like 70/65 then you can store the name in a temporary table or global cursor in the SPs and then retrieve it from the trigger code.
↧