Solved

How to load an Excel File into SQL server 2008 where data are not in order

Posted on 2010-09-07
5
379 Views
Last Modified: 2012-05-10
Hello I have a sample file named "Source.xls"  attached here for how I am getting the file from the source.
I want to load this file into SQL server 2008 DB with a order like the target format excel named "Target Format for load " attached here.

I am also not sure if the target is correct as I feel a bit hard to manage the historical data.
I want to maintain the history data for the source file.

Can any one suggest the best way to maintain this type of source data.
Note: I don't have any direct access to any DB except the target DB. This is the only way i can get the data. Please suggest the best way to handle the target structure.


Source.xls
Target.xlsx
0
Comment
Question by:ushastry
5 Comments
 
LVL 14

Expert Comment

by:Emes
ID: 33621530
Are you using ssis ?
0
 
LVL 8

Expert Comment

by:dba2dba
ID: 33627425
You can try using Import Export wizard or use an SSIS Package.

Below is some good information:

http://www.accelebrate.com/sql_training/ssis_tutorial.htm
0
 
LVL 26

Author Comment

by:ushastry
ID: 33629465
I am not using SSIS but i need if something can do this and I can get this data loaded into SQL server ,

But I can do this my importing it but if I want to maintain the data history then it is pitty much difficult as the source gives me the dates in columns and if in future I get some more dates which modification then thats where it is a big problem for me.
0
 
LVL 26

Author Comment

by:ushastry
ID: 33630033
If i use SSIS package to be created then can I store this type of data in one table.
If I get the source like this then will I be able to keep the history if I get similar kind of data of other users and may be with same dates ?
0
 
LVL 10

Accepted Solution

by:
itcouple earned 500 total points
ID: 33641619
Hi

It would be difficult to load the data in this format. I suggest to write a small macro to create 'flat file' which would convert columns into rows so it would look the same as your table and the table should look something like that:

Segment, Team, DisplayName, Name, Calls, Duration, AverageDuration, DayWorkd and Date.

Once you have the data in this format you can import it using SSMS import/export (which will append the data) you can also save as CSV file and do bulk load into "staging" table and fire SP which will do all your 'business logic'

.... Regarding keep history I'm not entirelly sure what you mean? The data shouldn't change you just append new dates?

Hope that helps

Regards
Emil
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question