Hands-On Microsoft SQL Server 2008 Integration Services part 64 ppt

10 146 0
Hands-On Microsoft SQL Server 2008 Integration Services part 64 ppt

Đang tải... (xem toàn văn)

Thông tin tài liệu

608 Hands-On Microsoft SQL Server 2008 Integration Services 9. You can also execute your package in this Designer in the usual way by clicking Execute. Save your package and close the Designer. 10. Using Windows Explorer, browse to the C:\SSIS\RawFiles folder and delete the Importing Contacts.dts package. 11. Now, go back to SQL Server Management Studio and right-click the Importing Contacts and choose Export from the context menu. 12. Specify C:\SSIS\RawFiles as the path to export Importing Contacts package. 13. Choose Start | Run; type cmd; and click OK. At the command prompt, type the following: C:\>dtsrun /F "C:\SSIS\RawFiles\Importing Contacts.dts" You will see that the package executes successfully and 49 rows are added to the Contacts table, as shown in Figure 14-9. Integration Services lets you run DTS 2000 packages as-is using the DTSRun.exe utility. For those who haven’t used Data Transformation Services of SQL Server 2000 and are facing migration challenges now, DTSRun.exe is the command- line utility used to run DTS 2000 packages. The jobs created in the SQL Server Agent to run DTS 2000 packages also use DTSRun to execute the jobs. This also means that all the jobs that were created in the SQL Server Agent will keep on Figure 14-8 Connection Properties for the Campaign database Chapter 14: Migrating to Integration Services 2008 609 running as is. If you who have extensively used DTSRun.exe and DTSRunui.exe, note that Integration Services provides equivalent, rather better utilities called dtexec and dtexecui. The dtexecui utility can be used to create commands for use with dtexec. Refer back to Chapter 6, where these utilities are covered in detail. Review In this exercise, you used SQL Server Management Studio to enumerate the packages stored in the sysdtspackages table of the MSDB database. You also used the import and export facility provided by SQL Server Management Studio and explored other available options. The important thing you learned is that Microsoft has provided a DTS 2000 Designer package as a separate download in the Feature Pack for SQL Server 2005 that you can install and use to edit existing DTS 2000 packages. This makes life much easier if you need to manage migration of DTS packages to Integration Services. In the next part of this chapter, you will learn how to include your existing DTS 2000 packages in Integration Services projects. Embedding DTS 2000 Packages in Integration Services Packages Integration Services lets you to create business solutions using a modular design so that you can build your package as a small unit of work to provide a piece of functionality that can be repeatedly used in various enterprise solutions. You can integrate these smaller units of work to form a complete solution using the Execute Package task. You learned about the Execute Package task in Chapter 5 and used it to build a solution in one of the Hands-On exercises as well. This is relevant if you are developing a new piece of functionality. What about the work that has been developed already using DTS 2000 packages? Do you have to develop that functionality in Integration Services also? Figure 14-9 Running a DTS 2000 package 610 Hands-On Microsoft SQL Server 2008 Integration Services Various scenarios may guide you to adopt a particular solution, but if you want to use your DTS 2000 package as a module in your Integration Services package, Integration Services provides a wrapper task that lets you do this, and that wrapper task is called the Execute DTS 2000 Package task. When you installed the Clients Tools Backwards Compatibility feature earlier, the Execute DTS 2000 Package task was also installed, though you may not have realized, it as it is not added in the Toolbox by default. Later in the following exercise you will add this task to the Toolbox in BIDS. Execute DTS 2000 Package Task Using the Execute DTS 2000 Package task, you can include a DTS 2000 package in your Integration Services project and run it using the DTS run-time engine. This task can be considered similar to the Execute Package task with the differences that this task runs DTS 2000 packages instead of SSIS packages and uses DTS run-time engine instead of SSIS run-time engine. However, both tasks are used to in the same way for the running child packages inside a parent package and even can be used together in one package without worrying about run-time conflicts, as both use different run-time engines that can coexist. Other benefits of using this task are modularity, reusability, and security. Let’s work through a quick Hands-On exercise to demonstrate usage of the Execute DTS 2000 Package task. Hands-On: Executing Importing Contacts Using the Execute DTS 2000 Package Task In this exercise, you will run a DTS 2000 package—the Importing Contacts.dts package—that is saved to the file system in the C:\SSIS\RawFiles folder using the Execute DTS 2000 Package task. Exercise (Configure the Execute DTS 2000 Package Task) 1. Start BIDS and create a new Integration Services project with the following details: Name Executing Importing Contacts Location C:\SSIS\Projects 2. When the new project has been created, go to Solution Explorer and rename the Package.dtsx package as Importing Contacts.dtsx. Click Yes to accept to rename. Chapter 14: Migrating to Integration Services 2008 611 3. Right-click in the Toolbox on any task and select Choose Items from the context menu. This opens up a Choose Toolbox Items dialog box where you can add or remove components in to Visual Studio. Click SSIS Control Flow Items tab and select Execute DTS 2000 Package task as shown in Figure 14-10. Click OK to add this task in to the Toolbox. 4. From the Toolbox, drop the Execute DTS 2000 Package task on to the Control Flow Designer surface. 5. Double-click the task to open the Execute DTS 2000 Package Task Editor. 6. In the General page, click in the StorageLocation field under the Location section to enable the drop-down arrow. Note that the drop-down list shows three options: SQL Server, Structured Storage File, and Embedded in Task, as shown in Figure 14-11. Depending on the storage location of the DTS 2000 package, choose the relevant option, and based on the option you choose, the editor’s interface changes to show only the relevant fields. When you choose the SQL Server option, the task will access packages stored in the sysdtspackages table of the MSDB database of the SQL Server you specify in the SQLServer field. If you choose the Structured Storage File option, the package will access the packages from the file stored on the file system. You can specify the path for this file in the File field. The third option, Embedded In Task, means the DTS 2000 package has been saved Figure 14-10 Adding the Execute DTS 2000 Package task into the Toolbox 612 Hands-On Microsoft SQL Server 2008 Integration Services internally in the Execute DTS 2000 Package task and you don’t have to specify the connection information of file or SQL Server for the DTS 2000 package. You can load the DTS 2000 package in this task by clicking Load DTS2000 Package Internally. To load the package, you first select either SQL Server or Structured Storage File location in the Location field and specify the relevant connection information in the Connection area. After choosing the PackageName, you can then click Load DTS2000 Package Internally and the package will be loaded in the task. When you save this project, the DTS 2000 package is saved within the task. This task will hold all the information required for executing the DTS 2000 package after that and removing the DTS 2000 package from original location wouldn’t affect the execution of this task. 7. For this exercise, select Structured Storage File in the Location field. 8. Specify C:\SSIS\RawFiles\Importing Contacts.dts in the File field. 9. Type the following in the General section: Name Importing Contacts Description This task is used to execute the named DTS 2000 package. Figure 14-11 Storage locations supported by Execute DTS 2000 Package task Chapter 14: Migrating to Integration Services 2008 613 10. Click in the PackageName field and then on the ellipsis button to open the Select Package dialog box. As the structured storage file can contain multiple packages and package versions, you are asked to choose the package you want this task to execute. Select a version for the Importing Contacts.dts package and click OK. The PackageID field will show the unique identifier for the selected version of the package. 11. As the Importing Contacts package doesn’t have a password, leave the PackagePassword field as is. The task should look like Figure 14-12. 12. You can edit the specified package by clicking Edit Package. The DTS 2000 Package Designer will open, where you can edit the package using legacy tools. If you haven’t installed the SQL Server 2000 DTS Designer components earlier, you will get an alert message asking you to install the Designer components. Close the DTS 2000 Package Designer window. 13. Go to Inner Variables page. Here you can specify and configure the inner variables that the DTS 2000 package uses. The variables and their values specified will be passed to the global variables in the DTS 2000 package. You can use the New button to add a new variable for which you can specify a type and can assign a value as well. This value will be used by global variables as the updated value at run time. Figure 14-12 Configurations for the Execute DTS 2000 Package task 614 Hands-On Microsoft SQL Server 2008 Integration Services 14. Go to Outer Variables page, where you can add an outer variable to the DTS 2000 package. Outer variables are used in the parent package—i.e., in an Integration Services package. When you click New, a blank row is added under the Name field, in which you can select a variable from the drop-down list of system and user-defined variables in the parent package. 15. Using the Expressions page, you can write an expression for any of the property for this task to update dynamically at run time. 16. Click OK to close this task and press -- to save the project. 17. Press 5 to execute the package. The task will change color to green and you will receive a success message in the Output window. 18. Press -5 to stop debugging and close the project. Review In this exercise, you learned another way of executing your DTS 2000 package using the Integration Services Execute DTS 2000 Package task. You can also include your legacy package as a child package in a parent SSIS package using this task. You also learned that you can use inner and outer variables to pass updated variables to the legacy package and can save DTS 2000 packages internally in the Execute DTS 2000 Package task. The option of loading and saving DTS 2000 packages internally is useful during migration of DTS to SSIS when dealing with custom tasks developed in DTS 2000. As the DTS 2000 custom tasks will not have a directly mapped task in Integration Services, the migration process encapsulates such tasks inside the Execute DTS 2000 Package task using the Embedded in Task feature and adds it in the migrated package. Migrating DTS 2000 Packages to Integration Services Once you understand the issues involved in migrating a DTS package to Integration Services, you can begin migrating most of your packages. To make life easier, Integration Services provides the Package Migration Wizard to help you migrate packages to the SSIS format. Some of the Data Transformation Services tasks didn’t fit well in the design and development of Integration Services software. This led to the removal of those tasks from Integration Services. Other tasks were developed into Integration Services. These tasks map directly and are converted to Integration Services tasks during migration, while custom DTS tasks or tasks that have been removed from Integration Services are either encapsulated in the Execute DTS 2000 Package task or replaced with a placeholder task. The following discussion tells you how the various components of SQL Server 2000 Data Transformation Services are mapped to Integration Services components and what happen when they are migrated to Integration Services. Chapter 14: Migrating to Integration Services 2008 615 ActiveX Script task c e SSIS version of this task is able to run most of the DTS ActiveX scripts; however, the scripts that reference DTS package objects may not successfully run on migration and you may have to edit the code manually. is task has been marked deprecated in SSIS and is provided to support existing DTS scripts. Analysis Services task c ough Integration Services has two built-in tasks, namely the Analysis Services Execute DDL task and the Analysis Services Processing task, neither of them directly map to the DTS 2000 Analysis Services task. is is because Integration Services tasks do not work with SQL Server 2000 Analysis Services. e migrated package contains the encapsulated functionality that must be manually migrated to Integration Services. Bulk Insert task c Directly maps to Bulk Insert task of Integration Services. Copy SQL Server Objects task c Migrates to Transfer SQL Server Objects task. Data Driven Query task c is task does not get migrated straight away, as it has no directly mapped task in Integration Services. e migrated package contains the encapsulated functionality of this task, which you have to migrate manually using Data Flow components based on the functionality provided by this task. Data Mining Prediction task c Directly maps to Data Mining Query task; however, in some cases you may find that the Data Mining Prediction task of SQL Server 2000 gets encapsulated in a placeholder task which you have to convert to a Data Mining Query task manually. Dynamic Properties task c ere is no direct mapping task in SSIS to the DTS 2000 Dynamic Properties task that is used to modify the DTS components dynamically at run time. is functionality has been achieved in Integration Services by the use of package configurations and property expressions. You learned about property expressions in Chapter 3 and package configuration in Chapter 13. On migration, this task is replaced by a placeholder task, which you have to convert manually using package configurations, property expressions, and variables in Integration Services. Execute Package task c is is migrated to the Execute DTS 2000 Package task in Integration Services. Execute Process task c is is converted to the Execute Process task in Integration Services after migration. Execute SQL task c Maps directly to the Execute SQL task in Integration Services. File Transfer Protocol task c Maps directly to the FTP task in Integration Services. 616 Hands-On Microsoft SQL Server 2008 Integration Services Message Queue task c is task maps directly to the Message Queue task in Integration Services. Send Mail task c Gets converted to Send Mail task of Integration Services. Transform Data task c is task has no direct mapping in Integration Services and gets encapsulated in the Execute DTS 2000 Package task on migration. e functionality provided by this task has been distributed among various data flow components in Integration Services. You must manually convert this functionality to the Integration Services format. Various transfer tasks c e SQL Server transfer tasks get converted to various transfer tasks in Integration Services. ese tasks have direct mapping tasks. Passwords c As the Integration Services has a different security architecture than Data Transformation Services, the passwords used to protect DTS packages don’t get migrated. However, you can configure the package protection level after the package has been migrated to Integration Services. For more details on security features, refer to Chapter 7. Variable c DTS 2000 packages contain only global variables, whereas Integration Services has a much enhanced variables architecture. For example, in an SSIS package you can use system variables, create user-defined variables, assign scopes and namespaces to variables, attach property expressions to variables to update their values dynamically at run time, and configure them to raise an event when their values are updated. On migration, the DTS 2000 package variables get migrated to the package scope in the user namespace. You can enhance the use of variables in your package after migration. Connections c e connections in the DTS 2000 package get migrated to connection managers in Integration Services for the tasks that get directly migrated. For the tasks that use connections and cannot be directly migrated, such as the Transform Data task, the connection stays the part of the intermediate package that encapsulates DTS 2000 task. It should be clear to see that the migration from DTS 2000 to the SSIS package may involve some development work due to the tasks that did not find their place in Integration Services. Removing these tasks from Integration Services does not mean that the functionality has been lost; rather, the functionality provided by these tasks has been enhanced. But the enhanced features have been distributed among various other components that must be used together to create the required functionality. Chapter 14: Migrating to Integration Services 2008 617 Depending on the complexity of your package and the tasks it contain, your package may get migrated without any additional effort or may migrate some of the tasks while encapsulating the others in the Execute DTS 2000 Package task, requiring only a bit of effort on your part to migrate completely; or they may not get migrated at all, and you have to then decide whether to use them with the DTS run-time support or rewrite the packages. In the following section, you will work with the Package Migration Wizard, the tool that you can use to migrate an SQL Server 2000 Data Transformation Services package to an Integration Services package. Package Migration Wizard Integration Services provides this tool that guides you step-by-step to migrate packages stored in SQL Server or a structured storage file. The Package Migration Wizard reads the DTS package and creates a new copy of the migrated package in Integration Services. It does not alter the source package, which stays available as is, if the migration process fails. The Package Migration Wizard can be started using one of the following methods: From SQL Server Management Studio, right-click the Data Transformation c Services node under the Legacy node of Management in the Object Explorer (see Figure 14-6) and choose Migration Wizard from the context menu. From BIDS, right-click the SSIS Packages node in the Solution Explorer and c select Migrate DTS 2000 Package from the drop-down list box. From the command prompt, go to the folder C:\Program Files\Microsoft SQL c Server\90\DTS\Binn and run the executable DTSMigrationWizard.exe. Let’s do a short Hands-On exercise on using the Package Migration Wizard. Hands-On: Migrating Importing Contacts to Integration Services Migrate the DTS 2000 package Importing Contacts into Integration Services format. Method You will use the Package Migration Wizard to migrate the package, and after migration is completed, you will execute the package to see the results. . functionality in Integration Services also? Figure 14-9 Running a DTS 2000 package 610 Hands-On Microsoft SQL Server 2008 Integration Services Various scenarios may guide you to adopt a particular. task in Integration Services. 616 Hands-On Microsoft SQL Server 2008 Integration Services Message Queue task c is task maps directly to the Message Queue task in Integration Services. Send Mail. Toolbox 612 Hands-On Microsoft SQL Server 2008 Integration Services internally in the Execute DTS 2000 Package task and you don’t have to specify the connection information of file or SQL Server

Ngày đăng: 04/07/2014, 15:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan