How To Insert Update delete changes from source table to Destination Table using Lookup in SSIS
Download SSIS Packages:
https://www.mediafire.com/file/t7ldszsu94bnibd/Lookuptransformation.dtsx/file
T SQL Code used in the video
======================
IF OBJECT_ID(‘AdventureWorks2019.HumanResources.EmployeeSource’) IS NOT NULL
DROP TABLE AdventureWorks2019.HumanResources.EmployeeSource
SELECT * INTO AdventureWorks2019.HumanResources.EmployeeSource
FROM AdventureWorks2019.HumanResources.Employee
SELECT * INTO AdventureWorks2019.HumanResources.EmployeeDestination
FROM AdventureWorks2019.HumanResources.Employeesource WHERE 1 = 2
SELECT * FROM AdventureWorks2019.HumanResources.EmployeeSource –where BusinessEntityID =5 –Source Table
SELECT * FROM AdventureWorks2019.HumanResources.EmployeeDestination –where BusinessEntityID = 5 –Destination Table
drop table AdventureWorks2019.HumanResources.EmployeeSource
–Truncate table AdventureWorks2019.HumanResources.EmployeeDestination
Truncate table AdventureWorks2019.HumanResources.EmployeeDestination
–SQL SCRIPT TO ADD AUDIT COLUMNS TO DESTINATION DIMENSION TABLE
ALTER TABLE AdventureWorks2019.HumanResources.EmployeeDestination ADD InsertedDate DATETIME
ALTER TABLE AdventureWorks2019.HumanResources.EmployeeDestination ADD UpdatedDate DATETIME
ALTER TABLE AdventureWorks2019.HumanResources.EmployeeDestination ADD Operation VARCHAR(2)
Update AdventureWorks2019.HumanResources.EmployeeSource set MaritalStatus = ‘M’ where BusinessEntityID = 2
Delete from AdventureWorks2019.HumanResources.EmployeeSource where BusinessEntityID = 2
Update AdventureWorks2019.HumanResources.EmployeeDestination set MaritalStatus = ? where BusinessEntityID = ?
====================
Comments are closed.