SSIS Demo Project1212
SSIS Demo Project1212
SSIS Demo Project1212
Submitted by
Harshith V
Trainee Software Engineer
Custom Solution Services
Excelsoft Technologies Inc
SSIS Demo Project
Introduction:
SSIS is a fast flexible data warehousing tool used for data extraction,
transformation, and data loading.
It makes it easy to load the data from one database to another database
such as SQL Server, Oracle, Excel file, etc.
It is a data warehousing tool used for data extraction, loading the data into
another database, transformations such as cleaning, aggregating, merging
data, etc.
SSIS tool also contains the graphical tools and window wizards workflow
functions such as sending email messages, ftp operations, data sources.
ETL (Extract, Transform, Load): SSIS is commonly used for ETL processes,
where data is extracted from multiple sources, transformed according to
business rules or requirements, and loaded into a destination database or
data warehouse.
Data Migration: SSIS can be used to migrate data from one database to
another, whether it's within the same server or across different servers.
1
SSIS Demo Project
Data Warehousing: SSIS plays a crucial role in building and populating data
warehouses. It can efficiently handle the extraction of data from various
sources, transforming it to fit the data warehouse schema, and loading it
into the warehouse.
2
SSIS Demo Project
Project Description
Create a SSIS Package that reads the data from any flat file source and load
the data into the OLE DB Destination based on the below conditions:
1. The data will be of student data with qualifications
2. The Qualifications listed in flat file are like
BCA,BCOM,BSC,MCA,MSC,MCOM,PHD
3. All the Under graduate student’s data must be maintained in one UG
table, likewise Post graduates in PG table and Ph.d in Professional
Courses table.
4. Maintain Log of the SSIS Package in another table called Execution_log
5. Execution_Log contains
3
SSIS Demo Project
Solution
4
SSIS Demo Project
In SSIS First we need to select Data Flow Task in order to select the data
from the flat file source and configuration of flat file source and data split.
In Dataflow task, the below diagram represents the design of the data flow
task,
5
SSIS Demo Project
6
SSIS Demo Project
Here Condition is given based on the qualification i.e if the first letter in
the qualification field is B means UG, M means PG, P Means
Proffessional_courses table in SQL Server.
7
SSIS Demo Project
8
SSIS Demo Project
9
SSIS Demo Project
These are the Configurations done In the below diagram Execute SQL Task 1 editor.
In SQL Statement field
USE SSIS
EXEC LogSSISExecution @NameOfTheJob =?
10
SSIS Demo Project
11
SSIS Demo Project
In Execute SQL Task Editor I have SQLStatement USE SSIS EXEC ExecutionLog
Note: All the sp’s that are used in this package is entered below.
12
SSIS Demo Project
13
SSIS Demo Project
LOG Table
14
SSIS Demo Project
Stored Procedures:
USE [SSIS]
GO
SET QUOTED_IDENTIFIER ON
GO
15
SSIS Demo Project
BEGIN
SET @STATUS = 1; -- Successfully completed
-- SET @MESSAGE='ALL ROWS INSERTED'
END
ELSE
BEGIN
SET @STATUS = 0; -- Not successfully completed
Parameters: None
Variables:
16
SSIS Demo Project
Logic:
17
SSIS Demo Project
USE [SSIS]
GO
SET QUOTED_IDENTIFIER ON
GO
18
SSIS Demo Project
SSIS Starttime sp
USE [SSIS]
GO
SET QUOTED_IDENTIFIER ON
GO
SET QUOTED_IDENTIFIER ON
GO
19
SSIS Demo Project
These stored procedures and the main procedure are designed to facilitate logging
SSIS (SQL Server Integration Services) package execution details into an
SSISExecutionLog table.
LogSSISExecution Procedure:
Purpose: This procedure is responsible for logging the execution details of an SSIS job
into the SSISExecutionLog table.
Parameters:
@NameOfTheJob: Represents the name of the SSIS job being executed.
Variables:
@StartTime: Stores the start time of the execution.
@EndTime: Stores the end time of the execution.
@DurationInSeconds: Stores the duration of the execution in seconds.
@Status: Indicates the status of the execution (1 for success, 0 for failure).
@Message: Stores a message indicating the status or any additional information.
Execution Flow:
Sets the @StartTime variable to the current date and time.
Calls two separate stored procedures, SSISExecutionStartTime and
SSISExecutionStopTime, to retrieve the start and end times of the execution,
respectively.
Calculates the duration of the execution in seconds.
Determines the status based on the start and end times.
Inserts the execution details along with the job name, start time, end time, duration,
status, and message into the SSISExecutionLog table.
SSISExecutionStartTime Procedure:
Purpose: This procedure retrieves the start time of the SSIS execution.
Parameters:
@StartTime: Output parameter to store the start time.
Execution Flow:
Sets the @StartTime parameter to the current date and time.
Returns the start time as the result.
20
SSIS Demo Project
SSISExecutionStopTime Procedure:
Purpose: This procedure retrieves the end time of the SSIS execution.
Parameters:
@EndTime: Output parameter to store the end time.
Execution Flow:
Sets the @EndTime parameter to the current date and time.
Returns the end time as the result.
Explanation:
The LogSSISExecution procedure manages the logging process by obtaining the start
and end times of the SSIS execution through separate stored procedures, calculating
the duration, determining the execution status, and finally inserting all relevant
details into the SSISExecutionLog table.
Together, these procedures create a logging mechanism for monitoring SSIS job
executions, capturing details such as timing, status, and any associated messages or
errors.
Other Projects
21