Answers for "Instead of TRIGGER"

SQL
0

Instead of TRIGGER

CREATE TRIGGER production.trg_vw_brands 
ON production.vw_brands
INSTEAD OF INSERT
AS
BEGIN
    SET NOCOUNT ON;
    INSERT INTO production.brand_approvals ( 
        brand_name
    )
    SELECT
        i.brand_name
    FROM
        inserted i
    WHERE
        i.brand_name NOT IN (
            SELECT 
                brand_name
            FROM
                production.brands
        );
END
Code language: SQL (Structured Query Language) (sql)
Posted by: Guest on October-21-2021

Code answers related to "Instead of TRIGGER"

Code answers related to "SQL"

Browse Popular Code Answers by Language