An SSIS to copy tables from a Source to a Destination. Directions:
- From Start, select SQL Server Business Intelligence Development Studio
- File
- New Project…
- Project types: Business Intelligence Projects
- Integration Services Project…
- Click “OK”
- New Project…
- Toolbox
- Drag "Transfer SQL Server Objects Task" to "Control Flow" tab's pane.
- Right-click choose Edit…
- Objects
- SourceConnection ‹New connection…› = NWDSQL
- SourceDatabase = NIS_empl_wage
- DestinationConnection ‹New connection…› = TESTSQL
- DestinationDatabase = NIS_empl_wage
- CopyData = True
- ExistingData = Replace (so not append (dup errors))
- ObjectsToCopy (expand)
- CopyAllTables = True (so not sprocs)
- Note: Leave all other options False. Ex., Table Options—Can leave all these False because it will just move data so Destination’s Primary Keys will remain.
- Objects
- Click “OK”
- Right-click choose Edit…
- Drag "Transfer SQL Server Objects Task" to "Control Flow" tab's pane.
- Save and Run
Note 1: Your Properties for the Transfer SQL Server Objects Task will now look like this:
- CopyAllTables = True (so not sprocs)
- CopyData = True
- DestinationConnection = TESTSQL
- DestinationDatabase = NIS_empl_wage
- ExistingData = Replace (so not append (dup errors))
- SourceConnection = NWDSQL
- SourceDatabase = NIS_empl_wage
Note 2: A DB "restore" by the DBA would nix Destination tables that do not exist in Source tables; but not this technique.
No comments:
Post a Comment