I want to import CSV file and convert columns into rows depending on Customer count(2nd record in each row of CSV file) and save to SQL table
--CSV file format
State, Customer_Count, Name_1, Total_1,Name_2, Total_2,Name_3, Total_3..can go upto 350
GA,2,'John Doe',14.00,'Roger Smith',15.00 
FL,3,'John Doe',14.00,'Roger Smith',15.00,'Sally Cox',16.00 
SC,5,'John Doe',14.00,'Roger Smith',15.00,'Sally Cox',16.00,'James Brown',17.00,'Rick Davis',18.00
Data in SQL table from csv file should look like this
State,Name,Total
GA,John Doe,14.00
GA,Roger Smith,15.00
FL,John Doe,14.00,
FL,Roger Smith,15.00
FL,Sally Cox,16.00 
I have multiple CSV files with millions of records. How can i achieve this using Integration Services or Bulk Data Import.
Amar:
I think for what you are describing I would use SSIS; if you are running SQL Server 2000, that would be DTS instead of SSIS. Other alternatives include the use of OPENROWSET, BULK INSERT, or BCP. Read about these alternatives in books online and choose the alternative that you think best fits.
|||
Dave
Hi Amar,
refer http://blogs.msdn.com/euanga/archive/2006/07/20/672272.aspx also.
Hemantgiri S. Goswami
sql 
No comments:
Post a Comment