Quantcast
Channel: Welcome To TechBrothersIT
Viewing all articles
Browse latest Browse all 1968

Execute Multiple Statements Update/Delete/Insert with Parameters in OLE DB Command Transformation in SSIS Package - SQL Server Integration Services (SSIS) Tutorial

$
0
0
In this video we will learn how to use Multiple Statement in OLE DB Command Transformation with parameters.

We will learn

  • How to read the data from Flat file source in SSIS Package
  • How to Write Insert statement with Parameters for OLE DB Command Transformation
  • How to Write Update Statement with Parameter/s for OLE DB Command Transformation
  • How to Write Delete Statement with Parameter/s for OLE DB Command Transformation
  • How to Execute Multiple Statements in OLE DB Command Transformation in SSIS Package
  • How to Map Multiple Statements Parameters to Input Columns in SSIS Package


Script for video demo: How to Call Multiple Statements in OLE DB Command Transformation in SSIS Package

USE [Test]
GO

--Create Sample Tables for SSIS Package for OLE DB Command Transformation Demo
CREATETABLE [dbo].[Customer_AS](
[CustomerId] [int] NULL,
[CustomerName] [varchar](100) NULL,
[StreetAddress] [varchar](100) NULL,
[City] [varchar](100) NULL,
[State] [char](2) NULL
)

CREATETABLE [dbo].[Customer_AS_Hist](
[CustomerId] [int] NULL,
[CustomerName] [varchar](100) NULL,
[StreetAddress] [varchar](100) NULL,
[City] [varchar](100) NULL,
[State] [char](2) NULL
)



CREATETABLE [dbo].[Customer_NA](
[CustomerId] [int] NULL,
[CustomerName] [varchar](100) NULL,
[StreetAddress] [varchar](100) NULL,
[City] [varchar](100) NULL,
[State] [char](2) NULL
)


--Select Statement To check the data in tables
Select * From dbo.Customer_AS
Select * from dbo.Customer_AS_Hist
Select * from dbo.Customer_NA



--Insert/ Update/Delete Statement those we used in OLE DB Command Transformation
Insertinto dbo.Customer_AS
Values (?,?,?,?,?)


--Update Statement for OLE DB Command Transformation
Update dbo.Customer_AS_Hist
set CustomerName=?
,StreetAddress=?
,City=?
,State=?
where CustomerId=?

--Delete Statement
Deletefrom dbo.Customer_NA
where CustomerId=?



Execute Multiple Statements Update/Delete/Insert with Parameters in OLE DB Command Transformation in SSIS Package 

Viewing all articles
Browse latest Browse all 1968

Trending Articles