Tải bản đầy đủ - 0 (trang)
1-8. Importing Excel 2007/2010 Data Using SSIS 2005

1-8. Importing Excel 2007/2010 Data Using SSIS 2005

Tải bản đầy đủ - 0trang

CHAPTER 1 ■ Sourcing Data from MS Office Applications



Figure 1-16.  Excel 2007/2010 data source in SSIS 2005

4.



Click All in the left pane. Enter Excel 12.0 for the Extended Properties, as shown in

Figure 1-17.



28

www.it-ebooks.info



CHAPTER 1 ■ Sourcing Data from MS Office Applications



Figure 1-17.  Extended Properties for Importing Excel 2007/2010 in SSIS 2005

You can now run the package and import the spreadsheet data.



How It Works

Instead of using the Excel data source in SSIS, you choose the OLEDB source. This is then configured to use the

ACE provider.



Hints, Tips, and Traps





Excel 2007 is not limited to 65,536 rows, as is the case with earlier versions, so you can

import correspondingly larger amounts of data. However, the time taken by SSIS to validate

this data can be prohibitive when designing a package in BIDS/SSDT—unless you display

the properties for the OLEDB data flow source and then set ValidateExternalMetadata to

False, as shown in Figure 1-18.



29

www.it-ebooks.info



CHAPTER 1 ■ Sourcing Data from MS Office Applications



Figure 1-18.  Delayed validation





You can alter the registry entry that SSIS uses to guess the data type of an Excel 2007 column

using the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\12.0\Access Connectivity Engine\Engines\

Excel\TypeGuessRows.



Setting this to 0 forces SSIS to read every row for each column; otherwise, you can alter the default of 8 to strike

a happy medium between incorrectly guessing the data type and long minutes spent waiting for SSIS to finish

parsing the spreadsheet.



1-9. Handling Source Data Issues When Importing Excel

Worksheets Using SSIS

Problem

You have data in Excel files that are failing to load due to truncation errors or that cannot be mapped to

destination columns due to data type errors.



Solution

Tweak the standard SSIS Excel source properties to handle tricky source data issues. Here are some techniques

that you can use:

1.



In the Data Flow pane of SSIS, right-click the Excel source task and select Show

Advanced Editor.



30

www.it-ebooks.info



CHAPTER 1 ■ Sourcing Data from MS Office Applications



2.



Select the Input and Output Parameters tab, and expand Output Columns. Then click

the column whose column length you wish to change. This is shown in Figure 1-19.



Figure 1-19.  Modifying datasource types in Excel

3.



Select Unicode String [DT_WSTR] and enter a length (500 in this example). Of course,

the columns will be those of your source data.



4.



Confirm by clicking OK.



5.



Add a Data Conversion task to the Data Flow pane and connect the Excel Source task

to it. Then double-click the Data Conversion task to edit it.



6.



Select the output column that you modified in step 3, and specify that the output data

type is String [DT_STR], with the length you require.



31

www.it-ebooks.info



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

1-8. Importing Excel 2007/2010 Data Using SSIS 2005

Tải bản đầy đủ ngay(0 tr)

×
x