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

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

cdn.s3techtraining.com
from cdn.s3techtraining.com More from this publisher
17.06.2013 Views

Chapter 18: Getting Integrated with Integration Services Connection Managers This is a bit of misnomer. This isn’t so much a list of connection managers as it is a list of connections. By taking a look at the Description column, you’ll see many of the key properties for each connection your package uses. Notice that in our example package, we have two connections, and if you look closely, you’ll see how one relates to file information (for our connection to the flat file we’re using) and there is another that specifically relates to SQL Server (the export source connection). Execution Options Do not underestimate the importance of this one. Not only does it allow you to specify how, at a high level, you want things to happen if something goes wrong (if there’s an error), but it also allows you to establish checkpoint tracking — making it easy to see when and where your package is getting to different execution points. This can be critical in performance tuning and debugging. Reporting This one is all about letting you know what is happening. You can set up for feedback: exactly how much feedback is based on which events you decide to track and the level of information you establish. Logging This one is fairly complex to set up and get going, but has a very high “coolness” factor in terms of giving you a very flexible architecture of tracking even the most complex of packages. Using this area, you can configure your package to write log information to a number of preconfigured “providers” (essentially, well understood destinations for your log data). In addition to the preinstalled providers such as text files and even a SQL Server table, you can even create your own custom providers (not for the faint of heart). You can log at the package level, or you can get very detailed levels of granularity and write to different locations for different tasks within your package. Set Values This establishes the starting value of any run-time properties your package uses. (There are none in our simple package.) Verification Totally different packages can have the same file name (just be in a different spot in the file system, for example). In addition, packages have the ability to retain different versions of themselves within the same file or package store. The Verification dialog is all about filtering or verifying what package/version you want to execute. Command Line 560 You can execute SSIS packages from the command line (handy when, for example, you’re trying to run DTS packages out of a batch file). This option within the SSIS Package Execution Utility is about specifying parameters you would have used if you had run the package from the command line. The utility will establish most of this for you; the option here is just to allow you to perform something of an override on the options used when you tell the utility to execute.

Executing the Package If you simply click Execute in the Package Execution Utility, your package will be off and running. After it runs, you should find a text file in whatever location you told your package to store it; open it up, take a look, and verify that it was what you expected. Executing Using the SQL Server Agent We haven’t really discussed the SQL Server Agent up to this point, but, from an SSIS point of view, think of the SQL Server Agent as a job scheduler that allows you to do the same thing as running DTExec.exe, but doing so on a specific time and frequency basis with very robust job and task scheduling systems to integrate your package into a larger set of system jobs. We will discuss the agent in a bit more detail in our next chapter. Executing a Package from Within a Program SQL Server offers a very rich object model that is usable from within any .NET language. The programmability object model is well beyond the scope of this book, but suffice to say that you can not only programmatically execute packages, but dynamically build packages to meet a certain need before executing them. A Final Word on Packages I want to take a moment and reiterate how much we’ve really only touched the surface of what’s possible. As I’ve said before, there are entire books (rather large ones actually) written around Integration Services as the sole topic. The package we focused on here was generated by the Import/Export Wizard, but the end product was a typical SSIS package. Not only could we edit it, but we could well have built it from scratch ourselves. We could easily add other tasks to deal with things like “scrubbing” data after importing it to some form of “staging” area and then perform additional tasks. We can add complex branching to deal with errors or perform several tasks in parallel; the possibilities go on and on. Summary Chapter 18: Getting Integrated with Integration Services SQL Server Integration Services is a robust Extract, Transform, and Load tool. You can utilize Integration Services to provide one-off or repeated import and export of data to and from your databases — mixing a variety of data sources while you’re at it. While becoming expert in all that Integration Services has to offer is a positively huge undertaking, getting basic imports and exports up and running is a relative piece of cake. I encourage you to start out simple, and then add to it as you go. As you push yourself further and further with what SSIS can do, take a look at other books that are specific to what SSIS has to offer. 561

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

Connection Managers<br />

This is a bit of misnomer. This isn’t so much a list of connection managers as it is a list of connections. By<br />

taking a look at the Description column, you’ll see many of the key properties for each connection your<br />

package uses. Notice that in our example package, we have two connections, and if you look closely, you’ll<br />

see how one relates to file information (for our connection to the flat file we’re using) and there is another<br />

that specifically relates to <strong>SQL</strong> <strong>Server</strong> (the export source connection).<br />

Execution Options<br />

Do not underestimate the importance of this one. Not only does it allow you to specify how, at a high<br />

level, you want things to happen if something goes wrong (if there’s an error), but it also allows you to<br />

establish checkpoint tracking — making it easy to see when and where your package is getting to different<br />

execution points. This can be critical in performance tuning and debugging.<br />

Reporting<br />

This one is all about letting you know what is happening. You can set up for feedback: exactly how much<br />

feedback is based on which events you decide to track and the level of information you establish.<br />

Logging<br />

This one is fairly complex to set up and get going, but has a very high “coolness” factor in terms of giving<br />

you a very flexible architecture of tracking even the most complex of packages.<br />

Using this area, you can configure your package to write log information to a number of preconfigured<br />

“providers” (essentially, well understood destinations for your log data). In addition to the preinstalled<br />

providers such as text files and even a <strong>SQL</strong> <strong>Server</strong> table, you can even create your own custom providers<br />

(not for the faint of heart). You can log at the package level, or you can get very detailed levels of granularity<br />

and write to different locations for different tasks within your package.<br />

Set Values<br />

This establishes the starting value of any run-time properties your package uses. (There are none in our<br />

simple package.)<br />

Verification<br />

Totally different packages can have the same file name (just be in a different spot in the file system, for<br />

example). In addition, packages have the ability to retain different versions of themselves within the<br />

same file or package store. The Verification dialog is all about filtering or verifying what package/version<br />

you want to execute.<br />

Command Line<br />

560<br />

You can execute SSIS packages from the command line (handy when, for example, you’re trying to run<br />

DTS packages out of a batch file). This option within the SSIS Package Execution Utility is about specifying<br />

parameters you would have used if you had run the package from the command line.<br />

The utility will establish most of this for you; the option here is just to allow you to perform something<br />

of an override on the options used when you tell the utility to execute.

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

Saved successfully!

Ooh no, something went wrong!