In ASE, in stored procedures @@ProcID
returns the ObjectID of the stored procedure. In triggers @@ProcID
returns the ObjectID of the stored procedure that caused the trigger to fire, or 0 if the trigger was fired because of a SQL batch.
In MS SQL Server, @@ProcID
returns the ObjectID of the object from which @@ProcID
is called. So in a trigger, @@ProcID
returns the ObjectID of the trigger.