Use output value from a stored procedure in instead of insert trigger?

  • Hi, newbie here... Not sure if this is a "newbie-like" question.

    I want to create an INSTEAD OF INSERT trigger on a view.  The trigger is fairly straight forward, except:

    1. The trigger needs to use the OUTPUT value from a stored procedure as a one of the fields values for the inserted record.

    2. The trigger needs to handle multi-row records on insert.

    3. The trigger needs to be real efficient, so I'd like to avoid using a high-overhead record-set looping mechanism (such as a cursor) to iterate through the rows of the "inserted" table.

    For example, a stored procedure named "sproc_encrypt" specifies @ciphertext as it's only OUTPUT variable.  For each inserted record, the stored procedure needs to be invoked and the value of @ciphertext should be used as the value for a specified field.

    Is this asking too much?

    Tom

  • Can you convert the sp into a function so you can use it in a select?

  • Went to lunch... fresh perspective...  determined a small design change would allow me to use a function used as the value expression.

    Thanks for your response!

    Tom

  • HTH.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply