Hi all,
I am importing excel data into three tables using SSIS. I've done package successfully.
Excel sheet contain below columns'
Id
Name
Sales_Stage
Primary_Sales_Rep_Login
Product
Description
First_Name varchar(100),
Last_Name varchar(100),
Street_Address varchar(1000),
Street_Address_2 varchar(1000),
Street_Address_3 varchar(1000),
City
State
Postal_Code
Country
Territory
Account_Id
Account
Main_Phone_Number
Main_Fax_Number
Record_State
HP_Customer_Agreement_
Legacy_opportunity_ID
LegacyAccount_ID
LegacyProduct
Now, i imported these columns into three tables, like as below.
create table tblproduct(
Id varchar(50),
Name varchar(200),
Sales_Stage varchar(200),
Primary_Sales_Rep_Login varchar(300),
Product varchar(300),
Description varchar(1000),
)
create table tblcustomer(
First_Name varchar(100),
Last_Name varchar(100),
Street_Address varchar(1000),
Street_Address_2 varchar(1000),
Street_Address_3 varchar(1000),
City varchar(100),
State varchar(100),
Postal_Code varchar(50),
Country varchar(100)
)
create table tbltransact(
Territory varchar(200),
Account_Id varchar(200),
Account varchar(200),
Main_Phone_Number varchar(30),
Main_Fax_Number varchar(30),
Record_State varchar(10),
HP_Customer_Agreement_ varchar(20),
Legacy_opportunity_ID varchar(50),
LegacyAccount_ID varchar(50),
LegacyProduct varchar(50)
)
After debug the package successfully completed. But the problem is all excel columns are storing in all destination tables. I need only required columns should be stored in three tales. And there is no problem in package. I used below query.
SELECT DISTINCT Id, Name, Sales_Stage, Primary_Sales_Rep_Login, Product, Description, First_Name + Last_Name AS Full_Name, IIF(ISNULL(Street_Address),'',Street_Address) + IIF(ISNULL(Street_Address_2),'',Street_Address_2) + IIF(ISNULL(Street_Address_3),'',Street_Address_3) AS Street, City, State, Postal_Code, Country, Territory, Account_Id, Account, Main_Phone_Number, Main_Fax_Number, Record_State, HP_Customer_Agreement_, Legacy_opportunity_ID, LegacyAccount_ID, LegacyProduct FROM [SiebelIndigoData$]
Please tell me anybody.