how to set up a trigger in sql
Create Trigger Product_Details_tr
on Product_Details
for Insert
as
being
insert into Product_Details_Audit_Log(audit_ID, update_time_stamp)
select Id, CURRENT_TIMESTAMP
from inserted
end
how to set up a trigger in sql
Create Trigger Product_Details_tr
on Product_Details
for Insert
as
being
insert into Product_Details_Audit_Log(audit_ID, update_time_stamp)
select Id, CURRENT_TIMESTAMP
from inserted
end
how use trigger in sql
CREATE TRIGGER Product_Details_tr
BEFORE INSERT ON Product_Details
FOR EACH ROW
SET NEW.User_ID = CURRENT_USER();
what is a trigger in sql
-- SQL Server Syntax
-- Trigger on an INSERT, UPDATE, or DELETE statement to a table or view (DML Trigger)
CREATE [ OR ALTER ] TRIGGER [ schema_name . ]trigger_name
ON { table | view }
[ WITH <dml_trigger_option> [ ,...n ] ]
{ FOR | AFTER | INSTEAD OF }
{ [ INSERT ] [ , ] [ UPDATE ] [ , ] [ DELETE ] }
[ WITH APPEND ]
[ NOT FOR REPLICATION ]
AS { sql_statement [ ; ] [ ,...n ] | EXTERNAL NAME <method specifier [ ; ] > }
<dml_trigger_option> ::=
[ ENCRYPTION ]
[ EXECUTE AS Clause ]
<method_specifier> ::=
assembly_name.class_name.method_name
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us