Showing posts with label SSIS. Show all posts
Showing posts with label SSIS. Show all posts

Thursday, February 18, 2016

How to read data from multiple Excel files with SQL Server Integration Services

I have data in multiple Excel files and all my Excel files are placed in the same folder. I want to create a SQL Server Integration Services (SSIS) Package which can read data from multiple Excel files and load the data into a SQL Server destination table. How can I achieve this using SSIS?
This tip explains how we can read data from multiple Excel files using SSIS and load the data into a SQL Server destination table. Please follow all the steps below to understand the solution.
Click here to read the article.

Wednesday, February 3, 2016

How to read data from multiple Excel worksheets with SQL Server Integration Services

My Excel source file has data in multiple worksheets and I need to read data from all of these sheets and load it into SQL Server destination table, how can I do this using SSIS?This tip explains how we can load data from multiple Excel sheets and load it into a SQL Server destination table.

Data Source

I have created a sample Excel source file and named it Excel_Souce.xls. This sample Excel file has three sheets and all three sheets contain data. The first row of each Excel sheet contains the column names and the data starts in the second row. My sample data looks like the below image.
Click here to read complete article

Sunday, January 17, 2016

How to read data from an Excel file starting from the nth row using SSIS

I have Excel files I need to read using SQL Server Integration Services (SSIS), but the first few rows in the file are just information about the data and these rows should be ignored. How can I read data from an Excel file starting from the nth row in SQL Server Integration Services.
The Excel source is one of the most used data sources in SQL Server Integration Services (SSIS). In this tip I will demonstrate how can we read Excel data starting from any row. Consider a scenario like the Excel file below screen where the data starts on row number 7
Click here to read complete article.

Friday, September 4, 2015

SSIS Toolbox is not visible in SQL Server Data Tools

The SSIS Toolbox is very important in SQL Server Integration Services to allow you to add components to the SSIS package. If you close the SSIS Toolbox sometimes making it display again doesn't work. In this tip we look at what is happening and how to resolve this issue.

check out complete article here.

Tuesday, July 7, 2015

Execute a SQL Server Reporting Services report from Integration Services Package

You have a requirement where a user does not want to use the SQL Server Reporting Services (SSRS) report subscription service, but wants to execute the SSRS report from a SQL Server Integration Services Package. In this case, whenever the user executes the package, a particular SSRS report will be executed and exported into Excel.  The exported Excel file will be saved in a shared folder. In this tip I will demonstrate how to solve this problem.

This tip assumes that you have previous real world work experience building a simple SSRS Report and SSIS package. I will use AdventureworksDW2008R2 sample database and SQL Server 2012 to demonstrate the problem and solution.
I have divided this tip in two parts.

Part 1: I will create a sample SSRS report and deploy it to the Report Server.
Part 2: I will create a SSIS Package which will execute the SSRS report created in Part1.

Read complete article here.

Thursday, February 12, 2015

Execute a SQL Server Reporting Services report from Integration Services Package

You have a requirement where a user does not want to use the SQL Server Reporting Services (SSRS) report subscription service, but wants to execute the SSRS report from a SQL Server Integration Services Package. In this case, whenever the user executes the package, a particular SSRS report will be executed and exported into Excel.  The exported Excel file will be saved in a shared folder. In this tip I will demonstrate how to solve this problem.

Click here to read full article.

Sunday, November 2, 2014

Read and Export Excel data from nth Row in SSIS

This post shows how we can read and export data from excel starting from nth row.

In SSIS we can read excel data starting from any number of row. Considering a scenario we have a excel file like below screen and we need to read data of Row 2 to Row 15.
To do this I create an Excel Connection manager in my SSIS package. I created a Data Flow Task in the control tab. On Data Flow tab I have following components. 


Right Click on the Excel Source and select properties.

In the OpenRowset you will find the sheet name from which you are extracting the data. You have to make modification here to read the data from the nth row or range.

As you can see from the below Image I have already updated the OpenRowset value to
Sheet1$A2:A15


Now double click on the excel source and click on preview button, as you can see from the below Image data was read from the row 2 to row 15.


I hope you enjoyed the article don't forget to share on Facebook. Please leave your comments below if there are any questions.

Check IsNumeric() with Derived Column Transform in SSIS


In SSIS we don’t have ISNUMERIC () equivalent within the SSIS expression language. You can't use ISNUMERIC() in an SSIS transform, such as a Conditional Split Transform or a Derived Column Transform, that doesn't mean you can't check to see if a field is numeric using the SSIS expression language. Using script task we can check this, using SQL command in Excel ( SELECT F1 FROM [SHEET1$] WHERE ISNUMERIC(F1)=-1) source we can check this, but in this tutorial I will show how we can check if a field is numeric without script task.

Create a sample excel file as shown below



As you can see from the above data our column has both numeric and string data. Now I want to check which row is numeric.

As I said before, there is a way we can use a Derived Column Transform (or Conditional Split) to check if a field is numeric.

Steps:
1-      Create Excel source connection
2-      Drag a Derived Column

After dragging in a Derived Column Transform into your Data Flow Task, create a new column to be added as a new column to your data flow. Give it a meaningful name to the new column and use this expression:

(DT_I4)Column == (DT_I4) Column? 1 : 0



Then near the bottom of the Derived Column Transform Editor window, click Configure Error Output. You need to tell SSIS to ignore failure on Error, as seen here:
  

Optionally, you could choose to redirect rows that are not numeric to the Error output of the Derived Column and then handle those rows there.

3-      Add another derived column and add data viewer on it.

Package should look like this.



On Execution you should get the below output.



You can see that the rows that are not numeric have a NULL value for the IsNumeric field we created with the Derived Column. Rows that are numeric have a 1. This way it is easy for us to determine which rows of a certain field is numeric and which are not numeric by checking for NULL.

I hope you enjoyed the article don't forget to share on Facebook. Please leave your comments below if there are any questions.