1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Execute a stored procedure within a trigger in sql server with parameters

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 7, 2024 às 11:22.

  1. Stack

    Stack Membro Participativo

    I have created a trigger which will execute a stored procedure on INSERT:

    USE [DB]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER TRIGGER [dbo].[trigger_name] ON [dbo].[table_name]
    AFTER INSERT AS
    BEGIN
    SET NOCOUNT ON
    EXEC procedure_name_exec param1, param2, param3
    END


    what I want to achieve is to execute the stored procedure with parameters which represent the row that has been just inserted and which basically triggered this trigger.

    Continue reading...

Compartilhe esta Página