1. Creating a trigger to update a column when a row is inserted:
2. Creating a trigger to insert data into another table when a row is updated:
3. Creating a trigger to delete rows from another table when a row is deleted:
CREATE TRIGGER trg_UpdateColumn
ON TableName
AFTER INSERT
AS
BEGIN
UPDATE TableName
SET ColumnName = 'New Value'
WHERE Id IN (SELECT Id FROM inserted)
END;
2. Creating a trigger to insert data into another table when a row is updated:
CREATE TRIGGER trg_InsertData
ON TableName
AFTER UPDATE
AS
BEGIN
INSERT INTO OtherTable (Column1, Column2)
SELECT Column1, Column2 FROM inserted;
END;
3. Creating a trigger to delete rows from another table when a row is deleted:
CREATE TRIGGER trg_DeleteData
ON TableName
AFTER DELETE
AS
BEGIN
DELETE FROM OtherTable WHERE Id IN (SELECT Id FROM deleted);
END;
👍5
sql server - Full execution history of a stored procedure - Stack Overflow
https://stackoverflow.com/questions/57886434/full-execution-history-of-a-stored-procedure
https://stackoverflow.com/questions/57886434/full-execution-history-of-a-stored-procedure
Stack Overflow
Full execution history of a stored procedure
I am wondering how to get the execution_time for all executions for a specific stored procedure. (using Microsoft SQL Server 2016)
I know that via dm_exec_procedure_stats I get information about the
I know that via dm_exec_procedure_stats I get information about the