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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

550<br />

Most of the time you’ll stick with whatever the default conversion was, based on the source data type,<br />

but sometimes you may want to change the output type in some way, for example, treating integer data<br />

as a string to deal with some expectation of the end destination of your data. (Not all systems treat what<br />

is seemingly the same data the same way.)<br />

Finally, you can mess with the nullability and scale/precision of your data. It’s pretty rare that you would<br />

want to do this, and it’s something of an advanced concept, but suffice to say that if you were to use more<br />

advanced transformations (instead of the default Import/Export Wizard), then this might be an interesting<br />

option to facilitate error trapping of data that isn’t going to successfully go into your destination<br />

system. In most cases, however, you would want to do that with WHERE clauses in your original query.<br />

Now, let’s click Cancel to go back to our Configure Flat File dialog, and then click Next to move onto the<br />

next dialog.<br />

At this point, you’ll get a simple confirmation dialog. It will synopsize all the things that you’ve asked<br />

the wizard to do — in this case:<br />

❑ Copy rows from [Query] to C:\Documents and Settings\xxx\My Documents\<br />

TestExport.txt.<br />

❑ The new target table will be created.<br />

❑ The package will be saved to the package file C:\Documents and Settings\xxxx\<br />

My Documents\Visual Studio 2005\Projects\Integration Services Project1\<br />

Integration Services Project1\Package1.dtsx.<br />

❑ The package will not be run immediately.<br />

Most of this is self-explanatory, but I want to stress a couple of things.<br />

First, it will create the file for us with the name specified; if, when we designed the package, the file had<br />

been detected as already existing, then we would have been given some options on whether to overwrite<br />

the existing file or just append our data onto the end of it.<br />

Perhaps more importantly, notice that a package is being created for you. This package is what amounts<br />

to an SSIS program. You can have SSIS execute that package over and over again (including scheduling<br />

it), and it will perform the defined export for you each time.<br />

Finally, note that it says that your package will not be run immediately; you need either to execute this<br />

package manually or schedule it to run.<br />

Click Next, and your package is created.<br />

Let me stress again that this is just something of a preparation step; your package has not run, and your<br />

data is not yet exported. You still need to execute or schedule the package to get your actual exported<br />

file. That side of things — the execution of the package — is the same for all SSIS packages though, and<br />

isn’t Import/Export Wizard-specific, so we’ll hold that side of things until the next section.

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

Saved successfully!

Ooh no, something went wrong!