Components I have used in my projects are Flat File source, Raw File source, Excel source, ADO NET source, XML source, OLE DB source.
When using Excel Source in SSIS, it does not pick up correct data types so I have to convert for example STRING Data type into Unicode String. The reason is SSIS auto determines the data types for when connecting to EXCEL Source. It prioritize data types based on top 8 records.
Some columns becomes NULL even when excel file contains data. We can fix this by adding IMEX=1 (Import Export Mode) property to the connection string.
No, Raw file source is available only to read raw files. It can only read the data from the file.
CSV file will be read by flat file source.
Yes. We can map the parameters of Stored Procedure in OLE DB source by using OLE DB Source editor and by clicking parameters button
The raw file destination writes raw data to a file. The format of the data is native to the sql server. So, it does not have to translate to specific format and data types. Hence it is faster than other destinations like flat file and OLE DB destinations.
|
OLE DB Destination |
SQL Server Destination |
|
It uses TCP/IP and names pipes. |
It uses Shared memory protocol. |
|
Less performance |
Better performance |
|
It does not require in OLE DB Destination. |
It requires users who execute packages must have “create global objects’ permission from local security policy. |
Data converstion , conditional split, derived column, Aggregate, sort
Merge, merge join, union all
fuzzy look up, look up
To perform UNION Transformation in SSIS, we can use UNION ALL and then pass output to Sort transformation removing rows with duplicate sort values. We can also use other aggregate transformation with Union All Transformationto perform Union operations in SSIS as well.
In SSIS, Sort transformation can help us to remove the duplicate records if we have small file. But if you want to load millions of records then load it into some staging table and then write T-SQL to extract unique records.
Script component transformation can be used as source, destination and transformation and write our own custom code by using C# or visual studio.
Merge accept sorted input, union all does not have to provide sorted input.
Merge accept only two input. Union allaccept any number of input.
Merge will output sorted data. Union all will usually give unsorted based on data.
[column_name]== “value_check” ? “if_true”:”if_false”
We can also add multiple if else statements all at once.
Copy column transformation create new column for us. It also can add new columns and on top of that e can concatenate columns and implement different functions like string, date or time or null functions on them
Copy column does not support Error output while derive column transformation support error output.
No, we don’t have month-name and day-name in SSISbut we can create two variables in our package with string data types and write on them to use them wherever we need month name and day name. Go to the properties of name variables and then configure using DATEPART and GETDATE for daynamelike : DATEPART(“dw”,GETDATE())==1? “Sunday”: and (MONTH(GETDATE())==1? “Jan”: for monthname.
email notification :Build package with some notification on it like creating error event handler error notification, when it fails it will error code and information to email. In SQL Server Agent job, we can set notification on failure.
EnableData Viewer in Data Flow, redirect row for error output, setbreakpoints like OnPreExecute, OnPostExecute event to see value before and after,
Always create package with logging like SSIS log provider for Text files, SQL Server, SQL Server Profiler, Windows Event Log and XML files.To capture information such as on error and on failure are very imp.Look into logs and try to understand that, and SQL Server Job History.
Smart ETL developer will have on failure email notification and logging for detail error information. If done that, will get email and you can look into problem.
If you haven’t set up error email notification, DBA will send information from job history and error message information from Job History( SQL Server Agent Job).
To further look into error details, check logging file or log records in table. You might need read permission to the folder where log files are created if SSIS Package is logging execution information to file system.
Data viewer can be used between two transformations to see the data. It is available in Data Flow.
Different transformations provide error output in case the operation can not be perform on input data. Yes, we can redirect rows from sources, transformations and destinations. For example in a flat file source, we can go to Error Output and select redirect row for Error and Truncation.
3 options in data flow to work with errors. they are FAIL COMPONENT, IGNORE FAILURE, REDIRECT ROWS
1. Job Frequency Details: explain how package is going to be executed.
2. Email Notification Details: explain type of notification package created. In case of data validation or hard failure like connection failure which team will be notified via email.
3. Audit Process on Package start: audit tables with package name, start time to track which packages are currently running and execution history of different packages.
Extraction process heading into sub heading like source, transformation and business logic, and destination.
4. Audit information on end of package
5. Dependencies: provide list of objects like stored procedure, tables, views, function, child packages on which package depends for successful execution.
6. Trouble shooting: list of common error/failure that can happen
7. Dynamic Package configurations: provide details about connection managers, variables. In case of SQL Server configuration provide database name, table and in case of XML configuration provide file path.
8. Logging and event handling:explain which type of logging is used. What type of event’s information is captured and what actions are done in event handler. Provide text file logging path or database name where log table exists.
9. Important links: provide all important linkif Business Required Document (BRD), Functional required document(FRD) or any documentation provided for package in shared folder or SharePoint site,
By using below code
USE [msdb]
GO
SELECT
Srv.srvnameAS ServerName,
Job.name AS JobName,
JStep.step_id,
JStep.step_nameAS StepName,
JStep.command,
Job.enabled
FROM dbo.sysjobs Job
JOIN dbo.sysjobstepsJStep
ON JStep.job_id= Job.job_id
JOIN MASTER.dbo.sysserversSrv
ON Srv.srvid= Job.originating_server_id
WHERE JStep.subsystem='SSIS'
ORDER BY Job.name,step_id
Checkpointsare used to restart packages from the point of failure instead to rerun the whole package or tasks. To implement checkpoints, select package, go its properties to find SSIS Checkpoint property. Select file name for CheckpointFileName, select IfExists for CheckpointUsage, saveCheckpoints to True and finally in Execution, set FailPackageOnFailure to True.
SSIS include log providers to implement logging in packages, containers and tasks. With logging, we can capture run-time, information about a package, helping you audit and troubleshoot a package every time it is run.
Types of logging Text File Logging, SQL Server Profiler, SQL Server, Windows Event Log and XML File.
Create expression for our Log File Name for each execution. Go to MyLogFile Connection Manager and right click on it. Go to properties and then expression and write expression as:
@[User::VarLogFolderPath]+"\\"+ @[System::PackageName]+"_"+Replace(Replace(Replace(SUBSTRING((DT_WSTR,50)(GETDATE()),1,16),"-","")," ","_"),":","")+".log"
[dbo].[sysssislog] table in system tables will be used to store log information.
Source,starttime, endtime and message are few important column names that sysssisloghave to store log information.
OnError, OnPostExecute, OnPreExecute, OnPreValidate, OnProgress,OnTaskFailed and OnWarning