Course 10057 - Implementing Packages and Control Flow in SQL Server Integration Services 2008

Embed Size (px)

DESCRIPTION

Course 10057 - Implementing Packages and Control Flow in SQL Server Integration Services 2008

Citation preview

Introducing Business Intelligence in Microsoft SQL Server 2008

Table of Contents

Creating Integration Services Packages1Introduction1Lesson Introduction1Lesson Objectives1Introduction to Packages2Package Properties in SSIS2Creating Data Sources and Data Source Views7Creating Connection Managers in a Package8Importing Packages9Implementing Control Flow Tasks: Part 110Introduction10Lesson Introduction10Lesson Objectives10Data Tasks11Data Flow task11Bulk Insert task11Execute SQL task12Using the Data Profiling Task14Data Profiling Task Properties14File and Network Tasks15File System task15FTP task15XML task16Send Mail task25Web Service task26Message Queue task27Scripting Tasks29Script task29ActiveX Script task29Execute Process task30Database Object Transfer Tasks32Transfer Database task32Transfer SQL Server Objects task32Transfer Error Messages task36Transfer Jobs task36Transfer Logins task37Transfer Master Stored Procedure task37Adding Tasks to the Control Flow39Implementing Control Flow Tasks: Part 240Introduction40Lesson Introduction40Lesson Objectives40Package Execution Tasks41Execute Package task41Execute DTS 2000 Package task42Analysis Services Tasks43Analysis Services Processing task43Data Mining Query task43Analysis Services Execute DDL task44Maintenance Tasks45Back Up Database task45Check Database Integrity task45Execute SQL Server Agent Job task45Notify Operator task45Execute T-SQL Statement task46Rebuild Index task and Reorganize Index task46Update Statistics task46Shrink Database task46History Cleanup task47Maintenance Cleanup task47Windows Management Instrumentation Tasks48WMI Event Watcher task48WMI Data Reader task49Working with Precedence Constraints and Containers50Introduction50Lesson Introduction50Lesson Objectives50Introduction to Precedence Constraints51Outcome-based Precedence Constraints52Success52Failure52Completion52Expressions within Precedence Constraints53Multiple Constraints54Introduction to Containers55Working with For Loop Containers56Working with Foreach Loop Containers57Foreach Loop Enumarator Types57Working with Variables59Introduction59Lesson Introduction59Lesson Objectives59Introduction to Variables in SSIS60System Variables in a Package61Package-based variables61Task-based variables61Container-based variables61Creating User-Defined Variables62Business Practices63Lab: Implementing Packages and Control Flow in Microsoft SQL Server 200864Lab Overview64Lab Introduction64Lab Objectives64Scenario65Exercise Information66Exercise 1: Creating SSIS Packages66Exercise 2: Working with Control Flow Tasks66Exercise 3: Managing Control Flow Tasks66Exercise 4: Working with Variables67Lab Instructions: Implementing Packages and Control Flow in Microsoft SQL Server 200868Exercise 1: Creating SSIS Packages68Exercise 2: Working with Control Flow Tasks69Exercise 3: Managing Control Flow Tasks71Exercise 4: Working with Variables74Lab Review76What is the difference between data sources and connection managers?76At what location should you save a package to create a package template?76What is the difference between a Data Flow task and a Bulk Insert task?76You want to control the execution of multiple SSIS packages. What would be the best task to use?76What type of precedence constraints can be used with the control flow component of SSIS?76What is the purpose of containers?77What is the purpose of variables?77Module Summary78Creating Integration Services Packages78Implementing Control Flow Tasks: Part 178Implementing Control Flow Tasks: Part 279Working with Precedence Constraints and Containers79Working with Variables79Lab: Implementing Packages and Control Flow in Microsoft SQL Server 200880Glossary81

i

Creating Integration Services PackagesIntroductionLesson IntroductionPackages represent the starting point for creating an SSIS solution. In addition to defining new packages, you can also add packages from other locations. After creating the package, the first step is to define data sources to connect to a wide range of data stores. You can also create data source view to specify the tables and views that will be used within the Integration Services package. If new packages are created on a regular basis, package templates can be defined to include common items, such as data sources and tasks, to save time when a new package is created.Lesson ObjectivesAfter completing this lesson, you will be able to: Explain what packages are. Create data sources and data source views. Use connection managers in a package. Describe how to create a package template. Import packages.

Introduction to PackagesPackages are the basic unit for holding the logic of extract, transform and load (ETL) operations within SSIS. When an SSIS project is created in Business Intelligence Development Studio, a default SSIS package is created named Package.dtsx. This can be renamed.Within the package, the core elements of the package logic can be configured including: Control Flow elements Data Flow elements Event handler elements SSIS package variables SSIS package configurationsThere are additional elements that can also be configured. SSIS provides a Package Explorer window that helps you to conveniently view all of the package components in a single window. This is useful in situations where you inherit packages and require a single place to view all of the SSIS package components.At the package level, there are several properties that can be configured. Similar to many of the properties that exist within Business Intelligence projects, these properties are categorized for organization purposes.The categories of properties that are available at the package level include: Checkpoints Execution Forced Execution Value Identification Misc Security Transactions Versions

Package Properties in SSISCheckpointsCheckpoints can be configured within a package to define restart points if a package should fail during its execution. This can be useful if a package can take time to execute. Without checkpoints, a failed package would have to be restarted from the beginning. With checkpoints, a failed package can be restarted from a checkpoint within the package, reducing the time it would take to rerun a package.

Package PropertyDescription

CheckpointFileNameThe name of the file that captures the checkpoint information that enables a package to restart.

CheckpointUsage Specifies when a package can be restarted. The values are Never, IfExists and Always. The default value of this property is Never.

SaveCheckpoints Specifies whether the checkpoints are written to the checkpoint file when the package runs. The default value of this property is False.

ExecutionThe properties that are found within this category determine the behaviour of the package execution at run time. It can determine if the package is disabled by using the disable property, or whether Event Handlers can be used within the package by using the DisableEventHandlers property. You can also control how the package handles package error.Package PropertyDescription

DelayValidationIndicates whether package validation is delayed until the package runs. The default value for this property is False.

DisableIndicates whether the package is disabled. The default value of this property is False.

DisableEventHandlersSpecifies whether the package event handlers run. The default value of this property is False.

FailPackageOnFailure Specifies whether the package fails if an error occurs in a package component. At package level, the only valid value of this property is False.

FailParentOnError Specifies whether the parent container fails if an error occurs in a child container. The default value is of this property is False.

MaxConcurrentExecutables The number of executable files that the package can run concurrently. The default value of this property is -1, which indicates that there is no limit.

MaximumErrorCount The maximum number of errors that can occur before a package stops running. The default value of this property is 1.

PackagePriorityClass The Win32 thread priority class of the package thread. The values are Default, AboveNormal, Normal, BelowNormal and Idle. The default value of this property is Default.

FailParentOnError Specifies whether the parent container fails if an error occurs in a child container. The default value is of this property is False.

Forced Execution ValueThis category of properties helps you to force the execution value that is set on the package.Package PropertyDescription

ForcedExecutionValue If ForceExecutionValue is set to True, a value that specifies the execution value that the package returns. The default value of this property is 0.

ForcedExecutionValueType The data type of ForcedExecutionValue.

ForceExecutionValue Specifies whether the execution value of the package is forced. The default value of this property is False.

IdentificationYou can define supplementary information for the package including the package creators name, creation data and package name. This area also holds the packages globally unique identifier (GUID).Package PropertyDescription

ForcedExecutionValue If ForceExecutionValue is set to True, a value that specifies the execution value that the package returns. The default value of this property is 0.

ForcedExecutionValueType The data type of ForcedExecutionValue.

ForceExecutionValue Specifies whether the execution value of the package is forced. The default value of this property is False.

CreationDate The date that the package was created.

CreatorComputerName The name of the computer on which the package was created.

CreatorName The name of the person who created the package.

Description A description of package functionality.

MiscMiscellaneous settings pertaining to the package can be set in this category of package properties.Package PropertyDescription

Configurations Click the browse button () to view and configure Package Configurations.

Expressions Click the browse button () to create expressions for package properties.

ForceExecutionResult The execution result of the package. The values are None, Success, Failure and Completion. The default value of this property is None.

LocaleId A Microsoft Win32 locale. The default value of this property is the locale of the operating system on the local computer.

LoggingMode A value that specifies the logging behaviour of the package. The values are Disabled, Enabled and UseParentSetting. The default value of this property is UseParentSetting.

OfflineMode Indicates whether the package is in offline mode. This property is read-only. The property is set at the project level. Normally, the SSIS Designer tries to connect to each data source used by your package to validate the metadata associated with sources and destinations. You can enable Work Offline from the SSIS menu, even before you open a package, to prevent these connection attempts and the resulting validation errors when the data sources are not available. You can also enable Work Offline to speed up operations in the designer, and disable it only when you want your package to be validated.

SuppressConfigurationWarnings Indicates whether the warnings generated by configurations are suppressed. The default value of this property is False.

SecuritySecurity provides you with the ability to set package-level security, including a package password for the encryption of the package through various settings.Package PropertyDescription

PackagePassword The password for package protection levels (EncryptSensitiveWithPassword and EncryptAllWithPassword) that require passwords.

ProtectionLevel The protection level of the package. The values are DontSaveSensitive, EncryptSensitiveWithUserKey, EncryptSensitiveWithPassword, EncryptAllWithPassword and ServerStorage. The default value of this property is EncryptSensitiveWithUserKey.

TransactionsPackages can have transactions settings to maintain the integrity of the ETL operation that is provided within the package. In this manner, if a package fails, then the data being loaded can be rolled back maintaining data integrity. The transaction isolation level is also defined in this category to determine the amount of concurrent access to the data.Package PropertyDescription

IsolationLevel The isolation level of the package transaction. The values are Unspecified, Chaos, ReadUncommitted, ReadCommitted, RepeatableRead, Serializable and Snapshot. The default value of this property is Serializable.

TransactionOption The transactional participation of the package. The values are NotSupported, Supported and Required. The default value of this property is Supported.

VersionsThis category within the package property helps you to provide user-defined information about the VersionBuild of the package. You can also specify comments about the build and the MajorVersion and MinorVersion information of the package. The VersionGUID is a read-only property, providing a GUID version of the package.

Package PropertyDescription

VersionBuild The version number of the build of the package.

VersionComments Comments about the version of the package.

VersionGUID The GUID of the version of the package. This property is read-only.

VersionMajor The latest major version of the package.

VersionMinor The latest minor version of the package.

Creating Data Sources and Data Source ViewsCreating data sources and data source views are typically the first steps that are performed after a package has been created. Data sources provide the connection information that can provide access to source data.Data source views are objects based on a data source that provides an abstraction of a subset of tables, columns and relationships from the data source.SSIS provides you with the ability to define data sources and data source views within an SSIS project. This ensures that data sources and data source views only need to be defined once and can be used multiple times by different packages in the same project.

Creating Connection Managers in a PackageConnection managers define connection information for different elements of a package. These can include tasks within the Control Flow or Event Handlers SSIS component, such as a Simple Mail Transfer Protocol (SMTP) connection manager for the Send Mail Task. The Data Flow task can also make use of connection managers for defining data sources and data destination.Connection managers are different from data sources and data source views as they are embedded within the package itself. This means that when a package is deployed, the connection managers are deployed with the package, unlike data sources and data source views that are part of the SSIS project files. However, connection managers can be created based on the data sources that are defined within the SSIS project file.

Importing PackagesYou can import existing packages into SSIS project files. Packages can be imported from the file system or from SQL Server and be integrated within Business Intelligence Development Studio for additional editing and redeployment.A package stored in the file system means that the package is stored within a logical drive on the server. A package stored in SQL Server means that the package is saved within SQL Server and can take advantage of the added security provide by SQL Server. The third option is the SSIS package store, which is a reference to the default package storage location on the file system. This, by default, is C:\Program Files\Microsoft SQL Server\100\DTS\Packages.

Implementing Control Flow Tasks: Part 1IntroductionLesson IntroductionThere are many tasks available in SSIS. These tasks provide great flexibility when defining the structure of the control flow. The tasks can be categorized into groups of tasks based on the functionality that they provide.The tasks can include working with data or working with the file system and network locations. The control flow is also extensible and can be facilitated by script and program execution tasks allowing the ability to interact with .NET languages, ActiveX and command prompt tasks. You can also use Transfer Database Objects tasks that can move database objects from one instance of SQL Server to another.Lesson ObjectivesAfter completing this lesson, you will be able to: Describe the data tasks. Work with the Data Profiling Task. Work with file and network tasks. Work with scripting tasks. Work with Transfer Database Objects tasks. Add tasks to the control flow.

Data TasksData tasks are Control Flow tasks that help you to work with data from various sources. The table describes the data tasks in SSIS.Data Flow taskThe Data Flow task is a core task used within SSIS to extract, transform and load data from a wide variety of data sources and destinations. You can define one or more Data Flow tasks within an SSIS package.The Data Flow task is a unique task within the control flow. This task has its own separate designer that you can access by double-clicking the Data Flow task.The Data Flow Designer is a rich development environment, in which you can configure data sources and destination. In addition, you can configure the wide variety of transformations to change the data that is moved as part of an ETL operation.The Data Flow task is commonly used in SSIS packages that load data warehouses. Separate Data Flow tasks may be created to populate staging tables. For example, a Data Flow task to populate dimension tables with another Data Flow task, and a Data Flow task to populate the fact tables with data.Bulk Insert taskThe Bulk Insert task can only transfer data from a text file into a SQL Server table. Note that the Bulk Insert task supports only Object Linking and Embedding, Database (OLE DB) connections for the destination database. While the Data Flow task can provide this capability, the Bulk Insert task is the most efficient method for this type of transfer, because it cannot perform transformations or error logging on the data while it is moving from the source file to the table. If the destination table or view already contains data, the new data is appended to the existing data when the Bulk Insert task runs. If you want to replace the data, run an Execute SQL task that runs a DELETE or TRUNCATE statement before you run the Bulk Insert task.The Bulk Insert Task Editor contains four property categories: General. This category includes a Name and Description property. Connection. This category includes a File property to define the source text file connection. The connection category also contains a Connection and Destination Table property to define the destination SQL Server database and table. The text file RowDelimiter and ColumnDelimiter property can be used to define the text file format or if the Format property is set to Use File, a FormatFile can be used to define custom mappings between the text file and SQL Server table. If you have a format file that was created by the bcp utility, you can specify its path in the Bulk Insert task. The Bulk Insert task supports both XML and non-XML format files. Options. On the Options page, the Codepage and DataFileType property is used to define the type of text file. The BatchSize determine how many rows are inserted into the table as a batch. A setting of zero means all rows in the text file are inserted as one batch. If a batch size is set, each batch represents a transaction that is committed when the batch finishes running. The FirstRow and LastRow properties determine the starting and ending row of the data in the text file. You can also use the MaxErrors property to determine the number of errors that are allowed before the Bulk Insert task fails.The Bulk Insert task is particularly useful in situations where data needs to be retrieved from a system that cannot be connected to SSIS. Text files can act as a great intermediary data source and the Bulk Insert task will minimise the time required to import the data into a SQL Server table.Execute SQL taskThe Execute SQL task helps you to run a SQL statement or stored procedure from within a package. The Execute SQL Task Editor contains many properties broken down into pages in the Execute SQL Task Editor.General. On this page, you can define a name and description for the task. A TimeOut property can be used to limit the time SQL statements have to execute. The CodePage can determine the locale that is used with variables generated by the Execute SQL task. The ResultSet property allows you to set the type of results returned. This can include Single Row, Full Result Set, XML or None. The SQL Statement category of properties includes properties that provide connection information to the source database and the type of statement the Execute SQL task will run. These properties include ConnectionType, Connection, SQLSourceType and SQLStatement. This will hold the SQL Statement itself. Within this same area, the ByPassPrepare property when set to False, can improve the performance of the Execute SQL task if it is run regularly.Parameter Mappings. This page can be used to map parameters within the SQL statement or stored procedures to variable values that exist within the package. With regards to OLE DB, Open Database Connectivity (ODBC) and Microsoft Office Excel connection managers, the parameters within the statements are represented as question marks (?) known as parameter markers. Therefore, if a SQL statement is issued as follows. SELECT FirstName, LastName, Title FROM Person.Contact WHERE ContactID = ?Using OLE DB and Excel connections, the parameter marker would be named 0 (zero). If a second parameter marker is added to the above query, it would be named 1. ODBC connections start parameter markers at number 1, so in the above query, using ODBC connection, this parameter marker would be named 1. This information is used to populate the Parameter Name property in the parameter mappings page. You can use the Data Type property to define the data type of the parameter and the Parameter Size property to define the size of variable length data types. You can use the Add and Remove buttons to manage parameter mappings. The Variable Name property is used to add a new or existing variable to which the parameter maps and the Direction property determines the type of parameter which could be an input parameter, output parameter or return code.Result Set. This page can be used to map the results of a SQL statement or stored procedures to a variable that exist within the package. You can use the Add button to add a result set or the Remove button to remove an existing result set. The Result Name property allows you to define a name for the result set, however, this name is dictated by the option chosen in the ResultSet property on the General page. If SingleRow is selected, the Result Name property can use either the name of a column returned by the query or the number that represents the ordinal position of a column in the column list of query. If the ResultSet property is set to Full Result Set or XML, the Result Name property must be named 0 (zero). The Variable Name is used to map the result set to a new or existing variable.Expression. This page helps you to use the property expressions to dynamically update the properties of the Execute SQL task at run time by using variables.You can use the Execute SQL task for the following purposes: Truncating a table or view in preparation for inserting data Creating, altering and dropping database objects such as tables and views Recreating fact and dimension tables before loading data into them Running stored procedures Saving the rowset returned from a query into a variable

Using the Data Profiling TaskThe Data Profiling task is a new feature to SQL Server 2008 that helps you to analyze and profile the data within tables that is stored in SQL Server 2000 or later versions. This task does not work with third-party or file-based data sources. To run a package that contains the Data Profiling task, you must use an account that has read/write permissions, including CREATE TABLE permissions, on the tempdb database.Data Profiling Task Properties General. Allows you to specify the DestinationType for the data profiler results, which can be an XML File connection or a variable. You then use the Destination property to specify the XML file name or variable name. The OverWriteDestination allows you to specify if data that exists within the destination can be overwritten. You also have a TimeOut property to limit the time it takes for the information to be loaded into the destination. Profile Requests Page. Allows you to determine the data that you want to profile and the type of profiling you want to perform. As a result, this page is broken into two parts. The top part of the Profile Request lists the profiling you wish to perform. On each request, the bottom part of the page will display the properties for the request. Expression. Enables the use of property expressions to dynamically update the properties of the Data Profile Task at run time by using variables.

File and Network TasksThere are a number of tasks within SSIS that allow you to interact with files of specific types and folders, which can be defined on local or remote locations.File System taskThe File System task helps you to interact with the file system so that you can add, remove or move a single folder or file. To work with multiple folders and files, you can use the File System task within a Foreach Loop Container.The File System task contains predefined operations that can be selected within the task including: Copy directory Copy file Create directory Delete directory Delete directory content Delete file Move directory Move file Rename file Set attributesThese options are used to populate the Operation property within the File System task. Additional properties include the Name and Description property. The OverwriteDestination property can be set to True or False to determine if files and folders in the destination can be overwritten.There is a SourceConnection and DestinationConnection property that helps you to point to a source and destination connection manager. However, if the IsSourcePathVariable and IsDestinationPathVariable is set to True, this changes the SourceConnection and DestinationConnection property to SourceVariable and DestinationVariable respectively. This helps you to retrieve the source and destination file path from a variable that may have been set in an earlier task within the package.The Expressions page in the File System Task Editor helps you to use the property expressions to dynamically update the properties of the File System task at run time by using variables.A File System task may be used to create a folder on the file system so that it is ready to receive files that are retrieved from elsewhere. For example, an FTP task may use the folder created by the File System task as a destination to move files.FTP taskThe FTP task can be used to download and upload files to a remote server. This task can also manage folders on the server.To connect to the FTP site, an FTP connection manager needs to be defined and is used to populate FtpConnection property in the FTP Task Editor.You can also provide a Name and Description. In addition, you can set the StopOnFailure property to True or False to determine if the FTP task stops, should it encounter a failure. These properties are defined on the General page of the FTP Task Editor.On the File Transfer page, there is a LocalPath property that allows you to set a file connection manager for the location of local files. However, if the IsLocalPathVariable property is set to True, this changes the LocalPath property to LocalVariable, allowing you to define the path from a variable that may have been set earlier in the package.This is the same with the RemotePath property that allows you to set a file connection manager for the location of remote files. However, if the IsRemotePathVariable property is set to True, this changes the RemotePath property to RemoteVariable, allowing you to define the path from a variable that may have been set earlier in the package. You also have the OverwriteFileAtDest property to determine if destination files can be overwritten.The Operation property is used to define the action that takes place within the FTP task including: Send files. Sends a file from the local computer to the FTP server. Receive files. Saves a file from the FTP server to the local computer. Create local directory. Creates a folder on the local computer. Create remote directory. Creates a folder on the FTP server. Remove local directory. Deletes a folder on the local computer. Remove remote directory. Deletes a folder on the FTP server. Delete local files. Deletes a file on the local computer. Delete remote files. Deletes a file on the FTP server.The Expression page helps you to use the property expressions to dynamically update the properties of the FTP task at run time by using variables.An FTP task is a useful medium to retrieve files from a third-party source on the Internet. Using the FTP task, you can connect to an FTP site, retrieve files and load the files into a local folder that may be used as data within the SSIS package.XML taskYou can work with XML documents by using the XML Control Flow task. With this task, you can modify an existing XML document or portions of an XML document with a number of prebuilt operations for working with XML data. The prebuilt functions include the following: Merge. This function provides the ability to merge a number of XML documents into one. You can do this by defining a base XML document and merging the contents of a second document into the base document.Merge Function Operations in the XML Control Flow Task The following are the options that are available for the Merge function when Merge is specified as the OperationType on the General page of the XML task. The key to using these options is that settings need to be specified for the base document and the second document on which the Merge operation is based.XPathStringSourceType Select the source type of the XML document. This property has the following options:

ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

XPathStringSource 1. If XPathStringSourceType is set to Direct input, provide the XML code or click the ellipsis button (), and then provide the XML by using the Document Source Editor dialog box.1. If XPathStringSourceType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If XPathStringSourceType is set to Variable, select an existing variable, or click to create a new variable.1. If the XPath statement returns multiple nodes, only the first node is used. The contents of the second document are merged under the first node that the XPath query returns.SaveOperationResult Specify whether the XML task saves the output of the Merge operation. OverwriteDestination Specify whether to overwrite the destination file or variable.DestinationType Select the destination type of the XML document. This property has the following options: ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

Destination 1. If DestinationType is set to File connection, select a File Connection Manager, or click to create a new connection manager.1. If DestinationType is set to Variable, select an existing variable, or click to create a new variable.SecondOperandType Select the destination type of the second XML document. This property has the following options: ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

SecondOperand 1. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button (), and then provide the XML by using the Document Source Editor dialog box.1. If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If SecondOperandType is set to Variable, select an existing variable, or click to create a new variable. Diff. This function compares two XML documents and detects the differences between the documents. The result of the differences is generated in a XML Diffgram Document. When the Diff function is selected, a number of options are available that allow you to define the precision of the comparison being made between the two XML documents.Diff Function Operations in the XML Control Flow Task Specify the options that are available for the Diff operation when Diff is selected as the OperationType on the General page of the XML Task.1. DiffAlgorithm. Select the Diff algorithm to use when comparing documents. This property has the following options.

ValueDescription

Auto Let the XML task determine whether to use the fast or precise algorithm.

Fast Use a fast, but less precise Diff algorithm.

Precise Use a precise Diff algorithm.

1. Diff Options. Set the Diff options to apply to the Diff operation. The options are as follows.

OptionDescription

IgnoreComments A value that specifies whether comment nodes are compared.

IgnoreNamespaces A value that specifies whether the namespace uniform resource identifier (URI) of an element and its attribute names are compared. If this option is set to true, two elements that have the same local name but a different namespace are considered to be identical.

IgnorePrefixes A value that specifies whether prefixes of element and attribute names are compared. If this option is set to true, two elements that have the same local name but a different namespace URI and prefix are considered identical.

IgnoreXMLDeclaration A value that specifies whether the XML declarations are compared.

IgnoreOrderOfChildElements A value that specifies whether the order of child elements is compared. If this option is set to true, child elements that differ only in their position in a list of siblings are considered to be identical.

IgnoreWhiteSpaces A value that specifies whether white spaces are compared.

IgnoreProcessingInstructions A value that specifies whether processing instructions are compared.

IgnoreDTD A value that specifies whether the DTD is ignored.

1. FailOnDifference. Specify whether the task fails if the Diff operation fails.

1. SaveDiffGram. Specify whether to save the comparison result, a DiffGram document.

1. SaveOperationResult. Specify whether the XML task saves the output of the Diff operation.

1. OverwriteDestination. Specify whether to overwrite the destination file or variable.

1. DestinationType. Select the destination type of the XML document. This property has the options listed in the following table.

ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

1. Destination. If DestinationType is set to File connection, select a File connection manager, or click to create a new connection manager.

If DestinationType is set to Variable, select an existing variable, or click to create a new variable.

1. SecondOperandType. Select the destination type of the XML document. This property has the following options.

ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

1. SecondOperand. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button () and then provide the XML by using the Document Source Editor dialog box.

If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.

If SecondOperandType is set to Variable, select an existing variable, or click to create a new variable.

Patch. Using the XML Diffgram Document from the Diff function, a new XML document is created from output of the Diff function.Patch Function Operations in the XML Control Flow TaskSpecify the options available for the Patch operation when Patch is specified as the OperationType on the General page of the XML task.1. SaveOperationResult. Specify whether the XML task saves the output of the Patch operation. 1. OverwriteDestination. Specify whether to overwrite the destination file or variable. 1. DestinationType. Select the destination type of the XML document. This property has the following options:

ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

1. Destination. If DestinationType is set to File connection, select a File connection manager, or click to create a new connection manager.If DestinationType is set to Variable, select an existing variable, or click to create a new variable.1. SecondOperandType. Select the destination type of the XML document. This property has the following options:

ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

1. SecondOperand. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button () and then provide the XML by using the Document Source Editor dialog box.

If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.If SecondOperandType is set to Variable, select an existing variable, or click to create a new variable. Validate. The Validate function helps you to compare the contents of the XML document to a XML Schema Definition (XSD) or Document Type Definition (DTD) Schema.Validate Function Operations in the XML Control Flow Task The following are the options that are available for the Validate function when Validate is specified as the OperationType on the General page of the XML task. SaveOperationResult Specify whether the XML task saves the output of the Validate operation. OverwriteDestination Specify whether to overwrite the destination file or variable. DestinationType Select the destination type of the XML document. This property has the following options: ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

Destination Select an existing File connection manager, or click to create a new connection manager.ValidationType Select the validation type. This property has the following options:

ValueDescription

DTD Use a Document Type Definition (DTD).

XSD Use an XML Schema definition (XSD) schema. Selecting this option displays the dynamic options in section, ValidationType.

FailOnValidationFail Specify whether the operation fails if the document fails to validate.ValidationType Dynamic OptionsValidationType = XSDSecondOperandType Select the source type of the second XML document. This property has the following options:ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

SecondOperand 1. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button (), and then provide the XML by using the Source Editor dialog box.1. If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If XPathStringSourceType is set to Variable, select an existing variable, or click to create a new variable. XPath. You can perform and use XPath statements against the XML document.Xpath Function Operations in the XML Control Flow Task The following are the options that are available for the XPath function when XPath is specified as the OperationType on the General page of the XML task. SaveOperationResult Specify whether the XML task saves the output of the XPath operation. OverwriteDestination Specify whether to overwrite the destination file or variable. DestinationType Select the destination type of the XML document. This property has the following options:ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

Destination 1. If DestinationType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If DestinationType is set to Variable, select an existing variable, or click to create a new variable.SecondOperandType Select the source type of the second XML document. This property has the following options: ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

SecondOperand 1. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button (), and then provide the XML by using the Source Editor dialog box.1. If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If XPathStringSourceType is set to Variable, select an existing variable, or click to create a new variable.PutResultInOneNode Specify whether the result is written to a single node.XPathOperation Select the XPath result type. This property has the options listed in the following table.ValueDescription

Evaluation Returns the results of an XPath function.

Node list Returns the selected nodes as an XML fragment.

Values Returns the inner text value of all selected nodes, concatenated into a string.

XSLT. You can customise the output of the XML document by applying Extensible Stylesheet Language Transformations (XSLT) to the XML document.XSLT Function Operations in the XML Control Flow Task The following are the options that are available for the XSLT function when XSLT is specified as the OperationType on the General page of the XML task. SaveOperationResult Specify whether the XML task saves the output of the XSLT operation.OverwriteDestination Specify whether to overwrite the destination file or variable.DestinationType Select the destination type of the XML document. This property has the following options:ValueDescription

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

Destination 1. If DestinationType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If DestinationType is set to Variable, select an existing variable, or click to create a new variable.

SecondOperandType Select the source type of the second XML document. This property has the following options. ValueDescription

Direct input Set the source to an XML document.

File connection Select a file that contains the XML document.

Variable Set the source to a variable that contains the XML document.

SecondOperand 1. If SecondOperandType is set to Direct input, provide the XML code or click the ellipsis button (), and then provide the XML by using the Source Editor dialog box.1. If SecondOperandType is set to File connection, select a File connection manager, or click to create a new connection manager.1. If XPathStringSourceType is set to Variable, select an existing variable, or click to create a new variable.

On the General page of the XML Task Editor, the OperationType option will allow you to select a specific function that you wish to use within the XML task. This will adjust the XML Task Editor with the options available for each function. Use the SourceType options to define the source of the XML document. These options can include Direct Input, File Connection and Variable. The Direct Input allows you to set the source connection as XML directly. The File Connection requires that a file connection manager pointing to the XML document is created separately and then used within the XML task. You can also point the source to a variable that holds the XML document.The Expression page helps you to use the property expressions to dynamically update the properties of the XML task at run time by using variables.Note that the XML task is not used to connect to an XML document that will be used as source data to be loaded into a separate destination. The XML task allows you to manipulate the XML data itself. An example could include using the Merge function to merge the contents of many XML documents into a single XML file for consolidation purposes.Send Mail taskThe Send Mail task helps you to connect to an SMTP server and interact with e-mail services within an SSIS package.Within the Send Mail Task Editor, the General page helps you to define a Name and Description for the Send Mail Task. The Mail page helps you to populate the SmtpConnection property with an SMTP connection manager that points to the e-mail server. The remaining properties relates to fields that are typically defined within an e-mail message. This includes the following properties: From To Cc BCc Subject Priority AttachmentsThe MessageSourceType property helps you to determine the source for the message within the e-mail message. A setting of DirectInput allows you to type in a message within the MessageSource property directly. However, the MessageSourceType can be set to FileConnection that allows you to point to a file connection manager that retrieves the message from a file. It can also be set to Variable that can retrieve the message contents from a variable that exists within the package.The Expression page helps you to use the property expressions to dynamically update the properties of the Send Mail task at run time by using variables.The Send Mail task is commonly used within SSIS packages to send an e-mail message to SSIS administrators about failures that occur within the package itself. This provides a useful notification mechanism if a package fails and you need to be informed about the failure.Web Service taskThe Web Service task can use a Hypertext Transfer Protocol (HTTP) Connection Manager to connect to a Web service and execute the methods that are available within a specific Web service. The HTTP connection manager provides the connection information but can only support anonymous and basic authentication. Note that Windows authentication is not available within the HTTP connection manager. The HTTP connection manager can be used to point to a Web site or a Web Service Description Language (WSDL) file. A WSDL file is an XML document that defines the network endpoints within the document so that it can be reused for other HTTP connection managers. Note that the WSDL file must be available locally on the server on which the SSIS package runs.Web services allow SSIS to communicate with software components using open protocols such as HTTP, SOAP and XML without the reliance on the platform on which the software component is running on. When connected to the Web service through the HTTP connection manager, you can expose the particular Web service method or property to add custom functionality to the SSIS package. There are many Web services available and they provide methods that perform an action from within a Web service, and properties, which enable the Web service to read data. In the Web Service task, methods are used that enable the Web Service task to perform an action such as modifying data. General Page. On the General page, you can define the connection by using the HTTPConnection property. The WSDLFile property can be used to provide the local path to the WSDL file. The Name and Description property is used to define the name and description of the Web Service task. The OverwriteWSDLFile determines whether the WSDL file for the Web Service task can be overwritten. Input Page. The input page helps you to control how the Web Service task interacts with a method within a Web service. The Service property helps you to select the Web Service to use and the Method property helps you to select a specific method to use from within the Web service to perform an action. You can type a description for the Web method by using the WebMethodDocumentation property. If the method requires inputs to run, you can specify the name and data type of the input by using the Name and Type property respectively. The Variables property allows you to specify the use of package variables to provide the inputs to the Web Service task and the Value is used to specify the value that is provided by the variable. Output page. If results are to be returned by the Web service method used, the output page is configured to determine how to store the results. The OutputType determines if the data is stored in a File or a Variable. If the option of File is selected, you must select a file connection manager to point to the file in which the results are stored or create a new File Connection Manager. If Variable is selected, you must select a variable or create a new Variable to store the results. Expressions page. The Expression page helps you to use the property expressions to dynamically update the properties of the Web Service task at run time by using variables.Suppose you have an SSIS package that is used to populate a data warehouse and process an Analysis Services cube. A Web Service task could be used at the end of a package to call the ReportServices2005 Web service. You can use the SetExecutionOptions method within the class to create a snapshot of the report that uses the data, which is being populated.This way, the report snapshots are created after the data warehouse is loaded and the cube processed, rather than relying on the snapshot being created on a schedule.Message Queue taskThe Message Queue task allows SSIS packages to integrate with the Microsoft Message Queue (MSMQ) component of Microsoft Windows. MSMQ helps you to send and receive messages between different systems that are not continuously connected. Therefore, messages can be queued and delivered later if the destination is unavailable. This is useful in situations where an SSIS package is working with asynchronous data loads.When defining a queue to hold messages in the Microsoft Message Queue, you define whether the queue is configured to send or receive messages. You also define the type of message that can sent and received. If the message meets the defined message type, the Message Queue task will proceed to process the message. An example could include a string message type. Here, you can configure a queue to only proceed if a specific string message is received by the queue. The message types that are available include: String message. When receiving messages, you can configure the task to compare the received string with a user-defined string and take action depending on the comparison. The comparison can be exact, case-sensitive or case-insensitive or use a substring. Variable message. You can configure the task to specify the names of the variables included in the message. When receiving messages, you can configure the task to specify both the package from which it can receive messages and the variable that is the destination of the message. Data file message. When receiving messages, you can configure the task to save the file, overwrite an existing file, and specify the package from which the task can receive messages. String message to variable. This option specifies the source message as a string that is sent to a destination variable. The String message to variable option is only available if the Message property in the Message queue task is set to Receive.Within the Message Queue Task Editor, the General page helps you to define a name and description for the task. The MSMQConnection property allows you to define an MSMQ connection manager and the Message property defines if the task is responsible for sending or receiving messages in the queue. If the version of the MSMQ component is running on Microsoft Windows 2000, set the Use2000Format property to True, to allow the task to format the messages in a Windows 2000 format.The Message property will change the Message Queue Task Editor pages based on the setting defined. If the Message property is set to Send message, a Send page appears and consists of the following properties: UseEncryption. This property determines if the messages sent are encrypted. EncryptionAlgorithm. The EncryptionAlgorithm is the algorithm used to protect the message, which could be RC2 or RC4 if UseEncryption is set to True. MessageType. This property includes the options of String message, which creates a StringMessage property to type in a string value, Variable message, which creates a VariableMessage property to map to a package variable value or data file message, which creates a DataFileMessage property to point to a specific file.If the Message property is set to Receive message, a Receive page appears and consists of the following properties: RemoveFromMessageQueue. This property indicates whether to remove the message from the queue after it is received. By default, this value is set to False. ErrorIfMessageTimeOut. This property indicates whether the task fails when the message times out, displaying an error message. The default is False. TimeoutAfter. If you choose to set ErrorIfMessageTimeOut to True, specify the number of seconds to wait before displaying the time-out message. MessageType. This can either be a value of String message, Variable message, Data File message or String message to variable. These options will dynamically change the remaining properties on the page to determine how the queue manages a particular message. For example, with the String message value selected, a Compare property and CompareString property is added to the editor to configure the criteria for the string comparison to determine if the receiving queue should proceed to process the message.The Message Queue task is useful in scenarios where your package is dependent on receiving data from other sources. For example, you may have a central data warehouse that relies on updates to the fact table from branch offices. There may be a number of Message Queue tasks that wait to receive the data from each branch office. On arrival, the Message Queue task will pass the data into your SSIS package to add the data to the fact table. When all of the branch office data has arrived it will then allow the SSIS package to continue and complete the load of the data warehouse.

Scripting TasksYou can add custom functionality in SSIS packages. A number of tasks are included to meet this requirement. Some of the tasks are as follows:Script taskThe Script task provides the ability to create custom tasks and transformations that are not provided by the built-in tasks in SSIS by using Microsoft Visual Basic (VB) or Microsoft Visual C# 2008.To use the Script task, the local machine on which the package runs must have Microsoft Visual Studio Tools for Applications installed. This provides a rich environment for building the custom scripts including IntelliSense and its own Object Explorer. You can access Microsoft Visual Studio Tools for Applications from within the Script Task. Microsoft Visual Studio Tools for Applications can be accessed by clicking the Edit Script button in the Script Task Editor. When the Edit Script is selected, Microsoft Visual Studio Tools for Applications opens an empty new project or reopens the existing project. The creation of this project does not affect the deployment of the package, because the project is saved inside the package file; the Script task does not create additional files. There are also additional properties that require configuration when using the Script task. General page. The General page is used to provide a name and description for the Script task. Script page. The ScriptLanguage property allows you to define the language that is used to create the Script within the Script task; this can either be set to Microsoft Visual Basic 2008 or Microsoft Visual C# 2008. The EntryPoint provides the starting point within the Script task that the SSIS run-time engine will call first when running the Script task within the package. The name defined in this property must match the name of the method within the Script in Microsoft Visual Studio Tools for Applications Designer. You can define which variables can be used by the script by using the ReadOnlyVariables and ReadWriteVariables properties and select the variables to use. Multiple variables must be separated by a comma delimited list. Expressions page. The Expressions page in the Script Task Editor helps you to use the property expressions to dynamically update the properties of the Script task at run time by using variables.The Script task is a powerful feature that helps you to overcome a situation where a built-in task or transformation cannot provide the required functionality. Examples can include connecting to custom data sources.ActiveX Script taskThe ActiveX Script task helps you to add custom logic to SSIS packages by using VBScript, Jscript or any scripting language that is installed on the local machine on which the package resides. In Data Transformation Services (DTS), ActiveX scripts provided the only means to add custom functionality to a DTS package. The ActiveX Script task, therefore, is provided for backward compatibility and is a deprecated feature of SSIS 2008. You should consider migrating the logic of scripts from within an ActiveX Script task to a Script task. Within the ActiveX Script task, you can configure the following options: General page. The General page is used to provide a name and description for the ActiveX Script task. Script page. The Language property helps you to specify the scripting language used to add the custom functionality and is dependent on the languages installed on the local computer. The Script property helps you to type in the script for the custom logic; however, you can click the Browse button in the ActiveX Script Editor to browse for an existing script file that would overwrite any script typed within the Script property. The Save button can save the script typed in the Script property to a file and the Parse button can be used to verify the syntax of the script defined within the Script property. The EntryMethod property defines the entry point to the script when the SSIS package calls the ActiveX Script task. The name defined here must match the name defined within the script. Expressions page. The Expressions page in the ActiveX Script Task Editor helps you to use the property expressions to dynamically update the properties of the ActiveX Script task at run time by using variables.Prior to SSIS, the ActiveX Script task was used in Data Transformation Services (DTS); the predecessor to SSIS, to perform loops within DTS packages. Within SSIS, the For Loop Container and Foreach Loop Container can now provide the same functionality. Consider replacing ActiveX Script tasks that perform this logic with the For Loop Containers and Foreach Loop Containers.Execute Process taskThe Execute Process task is typically used to call batch files that can perform command prompt tasks such as creating text files of data or calling applications. The following properties can be configured within the Execute Process task: General page. Use the General page to define a name and description for the Execute Process task. Process page. The process page is used to determine the behaviour of the process that is to be executed by the task. The RequireFullFileName property can be set to True or False and will fail the task if the full file name for the process is not found. The Executable property defines the name for the executable and the Arguments property can be used to pass in arguments as the executable is running. The path for the executable can be specified by using the WorkingDirectory property. The Executable can also work with variables. The StandardInputVariable provides the variable inputs to a process and the StandardOutputVariable can capture output from a process. In both cases, you must specify a variable to which these properties map to should they be required. You can use the SuccessValue property to define which integer value indicates a successful execution of a process, the default is 0 (zero). The FailTaskIfReturnCodeIsNotSuccessValue relates to this to fail the task if the success value is not return to the task. You can also specify a TimeOut value for the number of seconds a process can run, and in conjunction with the TerminateProcessAfterTimeOut property, indicate if the process is forced to end if the time out value is reach. You can also use the WindowStyle property to determine if a window is shown while the process is running. Expressions page. The Expressions page in the Execute Process Task Editor helps you to use the property expressions to dynamically update the properties of the Execute Process task at run time by using variables.Consider using the Execute Process task if your SSIS package can only interact with a third-party application through a batch file.Create the batch file to interact with the third-party application first, and then use the Execute Process task to call the batch file when needed within the package.

Database Object Transfer TasksSSIS provides a number of tasks that help you to access, copy, insert, delete and modify SQL Server objects and data. This can be useful for one-off tasks that may be needed to be performed by a database administrator.Transfer Database taskThe Transfer Database Wizard helps you to transfer a database from one instance of SQL Server 2000 or above and from one instance of SQL Server to another. This process can occur while the database is online or offline. However, the transfer is quicker if you perform it while the database is offline. You can also move the database to separate instances that exist within the same physical server. You can configure the following properties to the completed Transfer Database task. General page. The General page is used to provide a name and description for the Transfer Database task. Databases page. You can define the source and destination connection information by using the SourceConnection and DestinationConnection properties. The DestinationDatabaseName and DestinationDatabaseFiles properties can be used to determine the database name and filenames and locations of the database files of the destination database. You can also use the DestinationOverwrite property to determine whether the database on the destination server can be overwritten. The Action property determines whether the database is copied or moved and the Method property determines if the database will be moved in online or offline mode. You use the SourceDatabaseName and SourceDatabaseFiles properties to specify the database that is transferred and the ReattachSourceDatabase determines if the task will try to reattach the source database should the task fail. Expressions page. The Expressions page in the Transfer Database Task Editor helps you to use the property expressions to dynamically update the properties of the Transfer Database task at run time by using variables.The Transfer Database task is a useful task if you want to move a database from one instance of SQL Server that is on old hardware to a new instance of SQL Server that is held on a server with new hardware.Organizations may also use this task to create a copy of the database on a development SQL Server.Transfer SQL Server Objects taskYou can transfer specific SQL Server Objects from a database on an instance of SQL Server 2000 or above by using the Transfer SQL Server Objects task. However, if you transfer objects from SQL Server 2000, objects such as schemas, partition functions and partition schemes will not be supported. You use the Transfer SQL Server Objects task to transfer all objects, all objects of a type or only specified objects of a type. You can configure the Transfer SQL Server Objects task to include schema names, data, extended properties of transferred objects and dependent objects in the transfer. When copying data, you can specify whether to replace or append the existing data. In the Transfer SQL Server Objects task, you can configure the following properties: General page. The General page is used to provide a name and description for the Transfer SQL Server Objects task. Databases page. You can define the source and destination connection information by using the SourceConnection and DestinationConnection properties. The SourceDatabase and the DestinationDatabase properties can be used to determine the database name that will have objects moved to and from. There is a wide range of additional properties that can be configured and can be dependent on how various properties are configured. Additional Properties in the Transfer SQL Server Objects TaskStatic Options1. DropObjectsFirst. Select whether the selected objects will be dropped first on the destination server before copying.

1. IncludeExtendedProperties. Select whether extended properties will be included when objects are copied from the source to the destination server.

1. CopyData. Select whether data will be included when objects are copied from the source to the destination server.

1. ExistingData. Specify how data will be copied to the destination server. This property has the options listed in the following table:

Value Description

Replace Data on the destination server will be overwritten.

Append Data copied from the source server will be appended to existing data on the destination server.

Note: The ExistingData option is only available when CopyData is set to True.

1. CopySchema. Select whether the schema is copied during the Transfer SQL Server Objects task.

1. UseCollation. Select whether the transfer of objects should include the collation specified on the source server.

1. IncludeDependentObjects. Select whether copying the selected objects will cascade to include other objects that depend on the objects selected for copying.

1. CopyAllObjects. Select whether the task will copy all objects in the specified source database or only selected objects. Setting this option to False gives you the option to select the objects to transfer, and displays the dynamic options in the section, CopyAllObjects.

1. ObjectsToCopy. Expand ObjectsToCopy to specify which objects should be copied from the source database to the destination database.

Note: ObjectsToCopy is only available when CopyAllObjects is set to False.

The options to copy the following types of objects are supported only on SQL Server. They include the following:1. Assemblies1. Partition functions1. Partition schemes1. Schemas1. User-defined aggregates1. User-defined types1. XML schema collections

1. CopyDatabaseUsers. Specify whether database users should be included in the transfer.

1. CopyDatabaseRoles. Specify whether database roles should be included in the transfer.

1. CopySqlServerLogins. Specify whether SQL Server logins should be included in the transfer.

1. CopyObjectLevelPermissions. Specify whether object-level permissions should be included in the transfer.

1. CopyIndexes. Specify whether indexes should be included in the transfer.

1. CopyTriggers. Specify whether triggers should be included in the transfer.

1. CopyFullTextIndexes. Specify whether full-text indexes should be included in the transfer.

1. CopyPrimaryKeys. Specify whether primary keys should be included in the transfer.

1. CopyForeignKeys. Specify whether foreign keys should be included in the transfer.

1. GenerateScriptsInUnicode. Specify whether the generated transfer scripts are in Unicode format.

Dynamic Options1. CopyAllObjects = False

1. CopyAllTables. Select whether the task will copy all tables in the specified source database or only the selected tables.

1. TablesList. Click to open the Select Tables dialog box.

1. CopyAllViews. Select whether the task will copy all views in the specified source database or only the selected views.

1. ViewsList. Click to open the Select Views dialog box.

1. CopyAllStoredProcedures. Select whether the task will copy all user-defined stored procedures in the specified source database or only the selected procedures.

1. StoredProceduresList. Click to open the Select Stored Procedures dialog box.

1. CopyAllUserDefinedFunctions. Select whether the task will copy all user-defined functions in the specified source database or only the selected UDFs.

1. UserDefinedFunctionsList. Click to open the Select User Defined Functions dialog box.

1. CopyAllDefaults. Select whether the task will copy all defaults in the specified source database or only the selected defaults.

1. DefaultsList. Click to open the Select Defaults dialog box.

1. CopyAllUserDefinedDataTypes. Select whether the task will copy all user-defined data types in the specified source database or only the selected user-defined data types.

1. UserDefinedDataTypesList. Click to open the Select User-Defined Data Types dialog box.

1. CopyAllPartitionFunctions. Select whether the task will copy all user-defined partition functions in the specified source database or only the selected partition functions. Supported only on SQL Server.

1. PartitionFunctionsList. Click to open the Select Partition Functions dialog box.

1. CopyAllPartitionSchemes. Select whether the task will copy all partition schemes in the specified source database or only the selected partition schemes. Supported only on SQL Server.

1. PartitionSchemesList. Click to open the Select Partition Schemes dialog box.

1. CopyAllSchemas. Select whether the task will copy all schemas in the specified source database or only the selected schemas. Supported only on SQL Server.

1. SchemasList. Click to open the Select Schemas dialog box.

1. CopyAllSqlAssemblies. Select whether the task will copy all SQL assemblies in the specified source database or only the selected SQL assemblies. Supported only on SQL Server.

1. SqlAssembliesList. Click to open the Select SQL Assemblies dialog box.

1. CopyAllUserDefinedAggregates. Select whether the task will copy all user-defined aggregates in the specified source database or only the selected user-defined aggregates. Supported only on SQL Server.

1. UserDefinedAggregatesList. Click to open the Select User-Defined Aggregates dialog box.

1. CopyAllUserDefinedTypes. Select whether the task will copy all user-defined types in the specified source database or only the selected UDTs. Supported only on SQL Server.

1. UserDefinedTypes. Click to open the Select User-Defined Types dialog box.

1. CopyAllXmlSchemaCollections. Select whether the task will copy all XML Schema collections in the specified source database or only the selected XML schema collections. Supported only on SQL Server.

1. XmlSchemaCollectionsList. Click to open the Select XML Schema Collections dialog box. Expressions page. The Expressions page in the Transfer SQL Server Objects Task Editor helps you to use the property expressions to dynamically update the properties of the Transfer SQL Server Objects task at run time by using variables.The Transfer SQL Server Objects task allows you to be more selective about the specific objects to move between database in SQL Server, unlike the Transfer Database task.Use this task when you want to incorporate objects from a SQL Server database into your own database.Transfer Error Messages taskThe Transfer Error Messages task helps you to transfer one or more user-defined error messages from one instance of SQL Server to another. User-defined error messages are indicated to SQL Server as any message that has a message identity (ID) of 50,000 and above. You can also configure the Transfer Error Messages task to move only message that are defined within a specific language as well. In the Transfer Error Messages task, you can configure the following properties: General page. The General page is used to provide a name and description for the Transfer Error Messages task. Messages page. You can define the source and destination connection information using the SourceConnection and DestinationConnection properties. You can also determine what should happen with existing error messages that exist within the destination instance by using the IfObjectExist property to overwrite existing user-defined error messages, skip existing messages or fail if error messages already exist. The TransferAllErrorMessages property allows you to set the value to True or False to determine if all or specific error messages are transferred. If set to False, use the ErrorMessageList property to select the specific messages to move. You can use the ErrorMessageLanguageList property to select the language that the error message should be in to move across. Expressions page. The Expressions page in the Transfer Error Messages Task Editor enables the use of property expressions to dynamically update the properties of the Transfer Error Messages task at run time by using variables.Suppose you create user-defined error messages for use within a SQL Server instance. SSIS provides a task exclusively for the purpose of transferring these user-defined messages from one SQL Server instance to another, negating the need to manually recreating the messages.Transfer Jobs taskThe Transfer Jobs task helps you to transfer one or more SQL Server Agent jobs from one instance of SQL Server to another. You can define all the jobs or specific jobs to move and determine if the job should be enabled at the destination server. General page. The General page is used to provide a name and description for the Transfer Jobs task. Jobs page. You can define the source and destination connection information by using the SourceConnection and DestinationConnection properties. The TransferAllJobs property allows you to set the value to True or False to determine if all or specific jobs are transferred. If set to False, you use the JobList property to select the specific jobs to move. You can also determine what should happen with jobs with the same name that exist within the destination instance by using the IfObjectExist property to overwrite existing jobs, skip existing jobs or fail if the job already exist. You can use the EnableJobsAtDestination set to True or False to determine if the job is enabled at the destination. Expressions page. The Expressions page in the Transfer Jobs Task Editor helps you to use the property expressions to dynamically update the properties of the Transfer Jobs task at run time by using variables.Similar to the Transfer Error Message task, you can use the Transfer Job task to move all or specific jobs from one instance of the SQL Server Agent to another without the need to manually recreate the job.Transfer Logins taskUsing Transfer Logins task, you can transfer one or more SQL Server logins from one instance of SQL Server to another. This excludes the sa account even if it has been renamed. You can define all of the logins or specific logins to move and determine if the Security Identifier (SID) of the login should be copied to the destination server. General page. The General page is used to provide a name and description for the Transfer Logins task. Logins page. You can define the source and destination connection information by using the SourceConnection and DestinationConnection properties. The LoginsToTransfer property allows you to set the value of AllLogins, SelectedLogins or AllLoginsFromSelectedDatabases. If set to SelectedLogins, you use the LoginsList property to select the specific logins to transfer. You can also determine what should happen with Logins with the same name that exist within the destination instance by using the IfObjectExist property to overwrite existing logins, skip existing logins or FailTask if the login already exist. You can use the CopySids set to True or False to determine if the logins SID is copied to the destination. Expressions page. The Expressions page in the Transfer Logins Task Editor helps you to use the property expressions to dynamically update the properties of the Transfer Logins task at run time by using variables.You can use the Transfer Logins task to move Logins from one instance of SQL Server to another without requiring to manually recreate them.Transfer Master Stored Procedure taskIf you create user-defined stored procedures and store them within the Master database, you can use the Transfer Master Stored Procedure task to transfer one or more stored procedures from one instance of SQL Server to another. In the Transfer Master Stored Procedure task, you can configure the following properties: General page. The General page is used to provide a name and description for the Transfer Master Stored Procedure task. Jobs page. You can define the source and destination connection information by using the SourceConnection and DestinationConnection properties. The TransferAllStoredProcedures property allows you to set the value of True or False. If set to False, you use the StoredProcedureList property to select the specific stored procedures to transfer. You can also determine what should happen with stored procedures with the same name that exist within the destination instance by using the IfObjectExist property to overwrite existing stored procedures, skip existing stored procedures or FailTask if the stored procedures already exist. Expressions page. The Expressions page in the Transfer Logins Task Editor helps you to use the property expressions to dynamically update the properties of the Transfer Logins task at run time by using variables.The Transfer Master Stored Procedure task can only be used if you save your own user-defined stored procedures within the Master database.

Adding Tasks to the Control FlowAdding tasks to the Control Flow Designer is a straightforward task. You can add tasks by clicking and dragging a task from the Toolbox in Business Intelligence Development Studio to the Control Flow Designer. You can also connect Control Flow tasks together through precedence constraints.

Implementing Control Flow Tasks: Part 2IntroductionLesson IntroductionAdditional categories of Control Flow tasks are available in SSIS that provide additional functionality, which can be used to interact with components outside of SSIS.Lesson ObjectivesAfter completing this lesson, you will be able to: Work with Package Execution tasks. Work with Analysis Services Tasks. Work with Maintenance tasks. Work with Windows Management Instrumentation tasks. Configure Control Flow tasks.

Package Execution TasksYou can manage multiple SSIS and DTS packages within a single SSIS package by using one of the Package Execution tasks. This can prove very useful when there are complex data loads that are required to be broken into modular packages for management purposes. In addition, a package can be reused in different SSIS packages.Execute Package taskThe Execute Package task enables an SSIS package to run other SSIS packages. This helps you to break down complex data loads into separate packages and then bring them together under a single package. You can then add constraints to control the workflow of all the packages within a single SSIS package. The package that is used to run the SSIS packages within it is referred to as the parent package. The packages running within it are referred to as child packages. By default, child packages use the same processes as the parent package. However, if the ExecuteOutOfProcesspackage property is set to True, the child package will run on its own process. This independence means that if a child package fails, then the parent package can continue to run. However, more memory would be required to run the child packages process. You can also pass variable values form a parent package to a child package so that you can customize the setting within a child package based on variable values that are defined at a parent level. For example, a Parent Package System Variable named System::StartTime may be passed onto the child package, as a basis for determining the date that it should use as the starting point for retrieving data. You must use a Package Configuration to pass a Parent Package Variable to a child package. In the Execute Package task, you can configure the following properties: General page. The General page is used to provide a name and description for the Execute Package task. Package page. You use the Location property to determine if the package is retrieved from SQL Server or the File System. If SQL Server is selected, you must configure the Connection and PackageName property. If File System is selected, you then configure a Connections property. This will populate the PackageNameReadOnly property with the name of the File System package. If the child package is password protected, you must specify the password in the Password property. You can also determine if the child package should execute in its own process by using the ExecuteOutOfProcess property set to True. The default is False. Expressions page. The Expressions page in the Execute Package Task Editor helps you to use the property expressions to dynamically update the properties of the Execute Package task at run time by using variables.The Execute Package task is commonly used to bring together multiple SSIS packages and add constraints to control the order in which the packages should run.This can be useful when loading a data warehouse as well. You can encapsulate separate packages to load the different parts of the data warehouse and then integrate those separate packages within a single package to control the workflow by using the Execute Package task.Execute DTS 2000 Package taskIf you run SQL Server DTS packages, SSIS contains an Execute DTS 2000 Package task to run the DTS package from within an SSIS package. DTS makes use of Outer and Inner variables. Outer Variables are the equivalent of parent package variables in SSIS and Inner variables are the equivalent of child package variables. These can be used to pass variable values from a parent package to a DTS package. To run this successfully, you must first install the Runtime Support for DTS packages. This provides a DTS shell that enables you to manage DTS packages on SQL Server 2008 and run the Execute DTS 2000 package task. In the Execute DTS 2000 Package task, you can configure the following properties: General page. The General page is used to provide a name and description for the Execute Package task. The StorageLocation allows you to specify where the DTS package is located. This can have a value of SQL Server, Structured Storage file or Embedded in Task. After this is set, you use the PackageName property to select the DTS package to execute. Any password associated with the DTS package must be defined in the Password property. You can update the PackageID property and the EditPackage property will allow you to edit the DTS package if DTS design-time support has been configured. Inner Variables page. You use the Name and Type property to define the name and data type of the Inner variable. The Value property is used to set the value of the inner variable. Within this page, a New button is available to create a New Inner Variable and a Delete button is available to remove inner variables. Outer Variables page. You use the Name property to define the name of the outer variable that is provided by a parent package. On this page, a New button is available to create a New Outer Variable and a Delete button is available to remove outer variables. Expressions page. The Expressions page in the Execute DTS 2000 Package Task Editor helps you to use the property expressions to dynamically update the properties of the Execute Package task at run time by using variables.Although DTS support is enabled within SSIS, consider upgrading DTS packages to SSIS packages, because this is a deprecated feature available for backward compatibility only.

Analysis Services TasksInteraction with SQL Server Analysis Services (SSAS) is possible by utilizing the Analysis Services tasks within your SSIS packages.Analysis Services Processing taskThe Analysis Services Processing task helps you to process objects within Analysis Services including Cubes, Partitions, Dimensions and data mining models. You can process everything or be selective with the processing that occurs. You can also process different objects at the same time within a batch by defining that the objects are processed in parallel. This can speed up the processing of Analysis Services objects. However, you can process the objects in sequence as well. In the Analysis Services Processing task, properties that can be configured with the Analysis Services Processing task: General page. The General page is used to provide a name and description for the Analysis Services Processing task. Analysis Services page. The Analysis Services connection manager allows you to define an existing connection manager to Analysis Services. Alternatively, you can use the New button to create a new connection manager. The ObjectList allows you to specify the ObjectName, Type, ProcessOptions and Settings for the Analysis Services object to be processed. You can use the Add or Remove button to add or remove an object to and from the object list. The Batch SettingsSummary helps you to define the Processingorder and Transactionmode for the object. You can also define the behaviour of the task when there are Dimensionerrors, and specify a path for the log file by using the DimensionKeyerrorlogpath. You can also control whether dependant objects are processed by using the Processedaffectedobjects property. These settings can be changed by using the ChangeSettings button. The ImpactAnalysis button will open another dialog box that shows the impact of processing an object on dependant objects. Expressions page. The Expressions page in the Analysis Services Processing Task Editor helps you to use the property expressions to dynamically update the properties of the Analysis Services Processing task at run time by using variables.The Analysis Services Processing task is commonly used in SSIS packages that are used to load data warehouses.Typically, this is the last task that is added to SSIS and is used to process objects within Analysis Services after the data has been loaded into the data warehouse.Data Mining Query taskThe Data Mining Query task helps you to run Data Mining Expression (DMX) statements, which use prediction statements against a mining model. Prediction queries help you to use data mining to make predictions about sales or inventory figures as an example. You can then output the results to a new table. Unlike other SSIS tasks, the data mining query presents the properties in separate tabs with the following properties. Note that the Name and Description property is available on all tabs. Mining Model tab. The Mining Model tab is used to provide an existing connection to the Analysis Services database. You can specify a new connection by clicking on the New button. The Mining Structure allows you to specify the Data Mining Structure that is used as a basis for analysis. Query tab. The Query tab consists of three additional tabs within it. The BuildQuery tab allows you to write the DMX prediction query. If parameters are defined within the prediction query, you can use the ParametersMappings tab to map a DMX parameter to a SSIS variable. The Result Set tab allows you to map the results returned from a prediction query to an SSIS variable, which could be defined as a single row result or a Full Result Set. Output tab. The Output tab can be used to output the results to a dataset by using ADO.NET or a table by using OLE DB connection managers. Within this tab, you can define an existing connection or create a new connection by using the New button. Use the OutputTable to define the table in which the prediction query results are stored and choose whether to Drop and recreate the output table.Note that this is one of the few tasks where property expressions cannot be used.The Data Mining Query task helps you to issue DMX prediction queries against a pre-existing data mining structure.If your data load requirements involve automated pre