Transfer SQL Server Objects Task
The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server. For example, the task can copy tables and stored procedures. Depending on the version of SQL Server that is used as a source, different types of objects are available to copy. For example, only a SQL Server database includes schemas and user-defined aggregates.
Server roles, roles, and users from the specified database can be copied, as well as the permissions for the transferred objects. By copying the associated users, roles, and permissions together with the objects, you can make the transferred objects immediately operable on the destination server.
The following table lists the type of objects that can be copied.
|User-Defined Data Types|
|XML Schema Collection|
User-defined types (UDTs) that were created in an instance of SQL Server have dependencies on common language runtime (CLR) assemblies. If you use the Transfer SQL Server Objects task to transfer UDTs, you must also configure the task to transfer dependent objects. To transfer dependent objects, set the IncludeDependentObjects property to True.
When copying tables, you can indicate the types of table-related items to include in the copy process. The following types of items can be copied together with the related table:
You can also indicate whether the script that the task generates is in Unicode format.
You can configure the Transfer SQL Server Objects task to include schema names, data, extended properties of transferred objects, and dependent objects in the transfer. If data is copied, it can replace or append existing data.
Some options apply only to SQL Server. For example, only SQL Server supports schemas.
The Transfer SQL Server Objects task can include SQL Server database-level users and roles from the source, SQL Server logins, and the permissions for transferred objects. For example, the transfer can include the permissions on the transferred tables.
The Transfer SQL Server Objects task supports a SQL Server source and destination.
The task raises an information event that reports the object transferred and a warning event when an object is overwritten. An information event is also raised for actions such as the truncation of database tables.
The Transfer SQL Server Objects task does not report incremental progress of the object transfer; it reports only 0% and 100 % completion.
The execution value, stored in the ExecutionValue property of the task, returns the number of objects transferred. By assigning a user-defined variable to the ExecValueVariable property of the Transfer SQL Server Objects task, information about the object transfer can be made available to other objects in the package. For more information, see Integration Services (SSIS) Variables and Use Variables in Packages.
The Transfer SQL Server Objects task includes the following custom log entries:
TransferSqlServerObjectsTaskStartTransferringObjects This log entry reports that the transfer has started. The log entry includes the start time.
TransferSqlServerObjectsTaskFinishedTransferringObjects This log entry reports that the transfer has completed. The log entry includes the end time.
In addition, a log entry for an OnInformation event reports the number of objects of the object types that have been selected for transfer, the number of objects that were transferred, and actions such as the truncation of tables when data is transferred with tables. A log entry for the OnWarning event is written for each object on the destination that is overwritten.
The user must have permission to browse objects on the source server, and must have permission to drop and create objects on the destination server; moreover, the user must have access to the specified database and database objects.
The Transfer SQL Server Objects task can be configured to transfer all objects, all objects of a type, or only specified objects of a type. For example, you can choose to copy only selected tables in the AdventureWorks database.
If the Transfer SQL Server Objects task transfers tables, you can specify the types of table-related objects to copy with the tables. For example, you can specify that primary keys are copied with tables.
To further enhance functionality of transferred objects, you can configure the Transfer SQL Server Objects task to include schema names, data, extended properties of transferred objects, and dependent objects in the transfer. When copying data, you can specify whether to replace or append existing data.
At run time, the Transfer SQL Server Objects task connects to the source and destination servers by using two SMO connection managers. The SMO connection managers are configured separately from the Transfer SQL Server Objects task, and then referenced in the Transfer SQL Server Objects task. The SMO connection managers specify the server and the authentication mode to use when accessing the server. For more information, see SMO Connection Manager.
You can set properties through SSIS Designer or programmatically.
For more information about the properties that you can set in SSIS Designer, click one of the following topics:
For more information about how to set these properties in SSIS Designer, click the following topic:
For more information about programmatically setting these properties, click the following topic: