Creating Trigger in SQL Server Table

SQL Trigger
Trigger is a action which will perform when the table gets insert, update or delete. We can choose the options on what the trigger should get invoked and create the syntax as below

CREATE Trigger triggername
ON tblname
FOR INSERT,UPDATE,DELETE -- We can add or remove the criteria here
AS
BEGIN

-- Action steps needs to carried out should be given here.

END

Creating Trigger in SQL Server Table was last modified: November 15th, 2017 by Justin Antony

SSIS commit and Rollback

SSIS Commit Rollback

In SSIS each and every component will commit its transaction after it got executed. But if we have a scenario where the commit should take place only after a set of component execution in ETL and for this we have an option in the Connection Object – > Properties -> Set RetainSameConnection as True.

This will ensure to commit only if all the components went success belongs to the same connection object.

You can give explicit commit statement like

  1. Begin Transaction
  2. Commit Transaction
  3. Rollback Transaction -> This you can write under the ONERROR event

https://www.sqlpublic.com/wpcontent/uploads/2017/10/img_59f0cd54baa1f.png” rel=”nofollow”>https://www.sqlpublic.com/wpcontent/uploads/2017/10/img_59f0cd54baa1f.png” alt=”” />

SSIS commit and Rollback was last modified: November 15th, 2017 by Justin Antony

How to find trace or log information in sql server ?

For tracking the database for any incidents like droping any objects and event monitoring.

Starting the Trace
EXEC SP_Configure ‘default trace enabled’,1
RECONFIGURE

Stopping the Trace
EXEC SP_configure ‘default trace enabled’,1
RECONFIGURE

To find the trace information for any sql server table

select * from sys.traces where id =1

How to find trace or log information in sql server ? was last modified: October 14th, 2017 by Justin Antony