Home > SQL Server Tips > Data Warehousing and Business Intelligence > Open SSIS packages without validation using these SQL properties
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATA WAREHOUSING AND BUSINESS INTELLIGENCE

Open SSIS packages without validation using these SQL properties


Robert Sheldon
05.27.2008
Rating: -4.60- (out of 5)


Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


When you open a SQL Server Integration Services (SSIS) package in SSIS Designer or add components to a package, SSIS by default checks the data sources used by the various components. This process for SSIS package validation ensures that the external metadata is valid. If the metadata is not valid, you'll receive warning or error messages pointing to the problem. At times, you might want to override the default behavior and open the SSIS package without validation. SSIS supports two properties -- DelayValidation and ValidateExternalMetadata – that let you control the validation process on individual components.

Creating a basic SSIS package

A common scenario in which you might want to control the validation process is when your SSIS package creates database objects and then accesses those objects from within the same package. Figure 1 shows an SSIS package that, among other things, creates a table, populates it and then accesses it.

[IMAGE]
Figure 1: An SSIS package creates and populates a table and then accesses it. (Click on image for enlarged view.)

To support this package, I first created a set of tables, all of which are the same except for the names.

SELECT c.FirstName, c.MiddleName,
c.LastName, e.HireDate
INTO HumanResources.EmpHireDates1
FROM Person.Contact c
INNER JOIN HumanResources.Employee e
ON c.ContactID = e.ContactID

SELECT * INTO HumanResources.EmpHireDates2
FROM HumanResources.EmpHireDates1

SELECT * INTO HumanResources.EmpHireDates4
FROM HumanResources.EmpHireDates1

The package starts with an Execute SQL task that truncates the EmpHireDates2 and EmpHireDates4 tables. The first Data Flow task retrieves data from EmpHireDates1 and inserts it into EmpHireDates2. After the Data Flow task, an Execute SQL task creates the EmpHireDates3 ...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
SQL Server Business Intelligence (BI) and Data Warehousing
DBA career paths could lead to business intelligence
Are data warehouses made for the cloud?
Q&A: Business intelligence gets a facelift in SQL Server 2008 R2
Project Gemini gets a new name, Madison earns buzz
Speed up reports in SQL Server Reporting Services with caching
Data Transformation Services vs. SSIS: The key differences
Using package configurations in SQL Server Integration Services (SSIS)
How SQL Server 2008 components impact SharePoint implementations
Achieving high availability and disaster recovery with SharePoint databases
Recommended practices for SQL Server Analysis Services aggregations

Data Warehousing and Business Intelligence
Recommended practices for SQL Server Analysis Services aggregations
Creating and managing SQL Server Analysis Services partitions
Sharing SSAS cube data in SharePoint with PerformancePoint Server 2007
New data profiling tools in SQL Server 2008
Utilize SSAS for data predictions and classification using Excel
SQL Server 2008 Integration Services delivers new features
Parent-child dimensions in SQL Server 2005 with Analysis Services MDX
Change data capture in SQL Server 2008 improves BI reporting accuracy
Manage traces in SQL Server 2005 Analysis Services with XMLA commands
Tutorial: SQL Server 2005 Analysis Services

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
data aggregation  (SearchSQLServer.com)
data preprocessing  (SearchSQLServer.com)
data warehouse  (SearchSQLServer.com)
FileMaker  (SearchSQLServer.com)
GIS  (SearchSQLServer.com)
MOLAP  (SearchSQLServer.com)
pivot table  (SearchSQLServer.com)
Quiz: SQL Server 2000  (SearchSQLServer.com)
SQL  (SearchSQLServer.com)
T-SQL  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


table based on data pulled from EmpHireDates2. I used the following Transact-SQL statement within this task:

SELECT * INTO HumanResources.EmpHireDates3
FROM HumanResources.EmpHireDates2

The second Data Flow task retrieves data from EmpHireDates3 and inserts it into EmpHireDates4. The Execute SQL task that follows this Data Flow task then drops EmpHireDates3.

As you can see in Figure 1, the second Data Flow task shows a validation warning (the yellow triangle). This is because the EmpHireDates3 table does not yet exist, but the table is still referenced by a data flow component. Figure 2 shows the Data Flow tab for this Data Flow task. Notice that the OLE DB source, which references the EmpHireDates3 table, shows an error.

[IMAGE]
Figure 2: Data Flow tab for the Data Flow task. (Click on image for enlarged view.)

If you were to run this SSIS package, you would receive a validation error message (shown in Figure 3) that indicates there is an error in the data flow. Because SSIS by default validates each data source in a package before it runs the package, the validation fails because EmpHireDates3 does not exist, even though the package creates that table.

[IMAGE]
Figure 3: Receiving a validation error message when opening the SSIS package. (Click on image for enlarged view.)

The DelayValidation property

Not surprisingly, SSIS has a workaround. Here's how to open the SSIS package without validation using the DelayValidation property. Each executable within a package, as well as the package executable itself, supports the DelayValidation property. By default, this property is set to False. However, if you set the value to True, SSIS will run the package and delay validating that executable until it runs. If you refer back to Figure 1, you'll see the DelayValidation property in the Properties window. This is the DelayValidation property for the package executable. If you set it to True, the package will run as expected.

Note that setting the DelayValidation property at the package level does not prevent the initial validation process when you open the package. It simply delays any package-level validation when you run the package. That means that the package will still run, as in the example I showed you, but the warning will still appear when you open the package. This is important if you also want to prevent the validation when the package opens. In this case, you should set the DelayValidation property to True at the task level.

One reason it's useful to avoid validating your data sources when you open an SSIS package is that sometimes the process can take an enormous amount of time. It could be because of a remote data source, a data source that is slow to respond or a number of other reasons. If you're in the process of developing a package and you find yourself opening that package often, you can spend an inordinate amount of time waiting for SSIS to validate a source. In such cases, setting the DelayValidation property to True at the task level can be one of the most time-saving steps you take.

The ValidateExternalMetadata property

The DelayValidation property is only available to executables. In other words, you can set the property only on tasks, containers and the package itself. The property is not available to individual data flow components. However, data flow components such as the OLE DB Source component support the ValidateExternalMetadata property. If you refer back to Figure 2, you'll see the property in the Properties window as it appears for the OLE DB Source component.

By default, the ValidateExternalMetadata property is set to True, so SSIS validates the external metadata whenever you open the package, add a component or run the package. You can override this behavior by setting the property to False, and, as a result, SSIS will not validate the data source until it runs that component.

The ValidateExternalMetadata property has a more granular approach to managing the SSIS data source validation process. However, this property, when set to True, helps you avoid locking issues when your package is using transactions. For this reason, it might be better to use the DelayValidation property at the task level.

Whichever property you use is a valuable asset when developing any SSIS package, particularly when the validation processes are extremely slow. Validating packages in advance can also serve a valuable purpose and end up saving time, so be sure to use these properties judiciously.


ABOUT THE AUTHOR:   

[IMAGE]Robert Sheldon is a technical consultant and the author of numerous books, articles and training material related to Microsoft Windows, various relational database management systems (including SQL Server) as well as business intelligence design and implementation. He is also the author of the novel Dancing the River Lightly. You can find more information at www.rhsheldon.com.


Rate this Tip
To rate tips, you must be a member of SearchSQLServer.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SQL Server Development - .NET, C#, T-SQL, Visual Basic
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts