To achieve this task (Dynamically map source and destination table in XML file) we can use the task Microsoft.SqlServer.TableTransferGeneratorTask
- I am going to load the table data from source server to destination server without creating dataflow task in ssis package
- all table, column mapping I am going to configured in XML file like
- source table name and destination table name
- source column name and destination column name
- column length
- column data type
- I am going to use Microsoft.SqlServer.TableTransferGeneratorTask to achieve this task(Its Microsoft task)
- Please execute this script in any sql server database server
create database dbSource
go
create database dbDestination
go
use dbSource
go
Create Table Test(emp_id int)
go
insert into Test values (10)
insert into Test values (20)
insert into Test values (30)
go
Create table SourceSoaps (sSoapName varchar(20),sSoapCost decimal(15,4))
go
insert into SourceSoaps values('santoor',20.02)
insert into SourceSoaps values('mysoresand',50.23)
insert into SourceSoaps values('deve',852.02)
go
use dbDestination
go
Create Table Test(emp_id int)
go
Create table DestinationSoaps (dSoapName varchar(20),dSoapCost decimal(15,4))