Friday 7 April 2017

Transfer table records into different Schema through SSIS :

1 - Create a new Schema in Sql Server
create schema msm
2- Go to Visual Studio and create a new package
3- Select Source file and connect your server table (OLE DB Source)
4- Select Destination (OLE DB Destination)
5- Double click on OLE DB Destination and configure your Server Name
6-
 Click second New button and add your table name with new schema details. It will come like
CREATE TABLE [OLE DB Destination] (
    [CustomerId] int,
    [FirstName] nvarchar(50),
    [LastName] nvarchar(50),
    [Salary] money
)
put your schema and any name for the new table like
CREATE TABLE [new_schema].[Table_name] (
    [CustomerId] int,
    [FirstName] nvarchar(50),
    [LastName] nvarchar(50),
    [Salary] money
)
7- Execute your package
8-
select * from [dbo].[Customer]
select * from [msm].[new_tab]
Data copied into new schema with new_tab name

No comments:

Post a Comment