17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 18: Getting Integrated with Integration Services<br />

Executing P ackages<br />

There are a few different ways to execute an SSIS package:<br />

❑ From within the Development Studio: The Business Intelligence Development Studio, just like<br />

any other instance of Visual Studio, allows for the idea of you running your packages from<br />

within the development environment (you gotta be able to debug!).<br />

❑ The Execute Package Utility: This is essentially an executable where you can specify the package<br />

you want to execute, set up any required parameters, and have the utility run it for you on<br />

demand.<br />

❑ As a scheduled task using the <strong>SQL</strong> <strong>Server</strong> Agent: We’ll talk more about the <strong>SQL</strong> <strong>Server</strong> Agent<br />

in our next chapter, but for now, realize that executing an SSIS package is one of the many types<br />

of jobs that the agent understands. You can specify a package name and time and frequency to<br />

run it in, and the <strong>SQL</strong> <strong>Server</strong> agent will take care of it.<br />

❑ From within a program: There is an entire object model supporting the notion of instantiating<br />

SSIS objects within your programs, setting properties for the packages, and executing them.<br />

This is fairly detailed stuff — so much so that Wrox has an entire book on the subject (Professional<br />

<strong>SQL</strong> <strong>Server</strong> 2005 Integrations Services by Knight et. al, Wiley 2006). As such, we’re going to<br />

consider it outside the scope of this book other than letting you know it’s there for advanced<br />

study when you’re ready.<br />

Executing a Package Inside the Development Studio<br />

This works just like debugging most any Visual Studio project. Simply press F5, click the green arrow on<br />

the toolbar, or choose Start Debugging from the Debug menu. As it builds (assuming it builds successfully),<br />

you should see the Data Flow Task first turn yellow, and then green (indicating it ran successfully).<br />

If there were multiple steps to our package, then you would see each task fire in turn until the<br />

overall package was complete.<br />

Go ahead and run the package this way, and then check out the produced text file. (Its exact location will<br />

depend on whether you specified a full path in your file definition or how Visual Studio is configured.)<br />

Using the Execute Package Utility<br />

558<br />

The Execute Package Utility comes in two forms: A UI-driven application by the name of DTExecUI.exe, and<br />

a command-line version simply called DTExec.exe. For our exploration here, we’ll fire up DTExecUI.exe.<br />

You can also navigate using Windows Explorer and find a package in the file system (they end in .DTSX)<br />

and then double-click it to execute it. Do that to our original export package, and you should get the execute<br />

dialog shown in Figure 18-19.<br />

As you can see, there are a number of different dialogs that you can select by clicking on the various<br />

options to the left. Coverage of this could take up a book all to itself, but let’s look at a few of the important<br />

things on several key dialogs within this utility.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!