The Sample Components


There are three sample components provided, as discussed in the following sections.

JPG File EXIF Reader Source Adapter

JPEG or JPG files are a common image file format developed by the Joint Photographic Experts Group (JPEG). EXIF data can be embedded in JPG files to provide information about how, when, and where the image was captured. EXIF stands for Exchangeable Image File Format and can be very useful for keeping track of your image library. Currently, there are an ever-increasing number of tools being generated for reading the EXIF information from image files. For example, Windows XP, given certain settings, shows you some of the EXIF information by simply hovering over an image in an Explorer window. Figure 25.3 shows an example.

Figure 25.3. Viewing JPG image EXIF information in Windows XP.


The JPG File EXIF Reader Source or just Image File Source for short is a Data Source Adapter for reading the EXIF data. There are a number of fields that can be extracted, over 100. However, the Image File Source only extracts a few of the most interesting fields. It uses a MultiFile Connection Manager to point to where the image files are stored and produces one row with the EXIF data for every image file. Figure 25.4 shows a screenshot of the adapter at work.

Figure 25.4. Viewing JPG image EXIF information using the JPG File EXIF Reader Source Adapter.


The source is interesting because it shows just how flexible Integration Services can be. By marrying the Execution Engines with your custom components, you can build an entire custom solution stack. The source is also interesting because it is a working sample that you can debug, add to, and otherwise study. The sample source is available in the SAMPLES\SRC\CustomComponents\ImageFileSrc folder.

Data Profiler Transform

At the beginning of any Data Quality, Integration, Warehouse, or other Business Intelligence project, one of the most important and most overlooked steps is to profile the existing data. Profiling tells you how much work there will be to clean and conform your data. It gives you a better idea what kinds of data you have and what sorts of problems there will be with implementing the project. It helps you to understand things like how much space you'll need for storing the processed data or if you need to dedup source data.

The Data Profiler transform does rudimentary profiling, including string length, nulls, maximum, and minimum values. It is a simple sample, but could easily be expanded to do much more and different profiling operations. The Data Profiler is an asynchronous transform and consumes all data on the input to produce one row for every profile type on every column profiled. For example, if you select two columns on the input to be profiled, and there are two profile types available for the selected column's type, the Data Profiler transform produces four rows.

The SQL Client and ODBC Destination Adapters

Although these are two distinct components, they are really just two sides of the same coin and should help you understand how to modify a sample to meet your specific requirements. The SQL Client Destination uses the Microsoft SQL Client ADO.NET Destination Adapter. It also uses the batching capability to help speed performance. It has a custom property called BatchSize you can set to tune the performance. The ODBC.NET Destination Adapter is a slightly modified version of the SQL Client Adapter to reflect the differences in the two providers. Either one of these two adapters could easily be modified to create other destination adapters.

Sample Transform UI

There is no sample transform user interface (UI) provided because, unlike the control flow that provides no standard UI for tasks, the data flow provides a standard component UI in the Advanced Editor. Although it is possible to write a custom component UI, few seem interested because the Advanced Editor covers most of the custom component UI requirements.

Tip

The Advanced UI is not capable of editing components with multiple inputs. If you write such a component, you need to also provide a custom component UI. The one exception to this is if the custom component has only component-level properties, in which case the Advanced UI will suffice.


Also, you can associate custom TypeEditors with custom properties that the Advanced Editor will use for editing properties. Finally, there is some especially well-done documentation on writing custom components found in Books Online. Perform a search for "Developing Custom Data Flow Components" for the index into the content.

Note

Chapter 24 covers in detail how to start the custom component projects. The differences between component types are also noted there. If you need to start from scratch, please review that chapter.




Microsoft SQL Server 2005 Integration Services
Microsoft SQL Server 2005 Integration Services
ISBN: 0672327813
EAN: 2147483647
Year: 2006
Pages: 200
Authors: Kirk Haselden

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net