• subscribe
May 22, 2002 12:00 AM

Returning a Trigger's Results to a Stored Procedure

SQL Server Pro
InstantDoc ID #24990

How can I create an INSTEAD OF trigger that returns results to the calling stored procedure? And how does this stored procedure call the trigger?

In SQL Server, a calling stored procedure can't directly invoke a trigger. Instead, SQL Server invokes a trigger when data on which the trigger is created is changing. However, any trigger can return a result set to a client application. The key is that the application has to process the results, as Listing 2 shows. In general, you should avoid returning results from triggers because doing so requires that you explicitly code your application to expect what would typically be unexpected results.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here