Karol
Karol

Reputation: 117

Load data, keys and indexes with SQL Server Integration Services (SSIS)

I have created the package SQL Server Integration Services (SSIS) that loads data from one server to another (records from table to records to another table).

enter image description here

It works properly, but unfortunately destination table do not have a keys and indexes (source table has).

How to load data with keys and indexes?

Upvotes: 1

Views: 414

Answers (1)

BarneyL
BarneyL

Reputation: 1362

SSIS is used to move data from one place to another. Keys and indexes are part of the structure of the destination table not part of the data itself and so SSIS cannot "load" them. Potentially the destination structure you move the data into could be very different from the source (and in fact I'd expect this in most cases if you're moving data out of a transactional system into a data warehouse for example). You also need to consider that it could be reading from multiple sources each with different indexes and keys.

If you're looking to replicate structure rather than the data then you need a different tool. This could be a simple as using SSMS to script the table out from the source and re-running on the destination or something more advanced such as using Visual Studio database projects.

Upvotes: 2

Related Questions