Solved

How do I append a SQL table with an excel worksheet

Posted on 2011-02-11
3
306 Views
Last Modified: 2012-06-27
I have a SQL table named EMPLOYEES which includes a primary key field named REF_ID (automatically assigned when a new record is created) and a BADGENUMBER field.

I need to append the data from an excel file named NEWHIRES, without adding any duplicates(rows where the data in the BADGENUMBER field already exists in the table.

Thanks
0
Comment
Question by:kimberlys777
3 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 250 total points
ID: 34876131
standard technique would be to have a sql server job to import the spreadsheet into
a work table, and then rename/archive the spreadsheet....

then a second step would process the new data from the work table into the main system...

then a third step would deal with any clashes,... report them

and tidy up the work table ready form the next process... (delete the read in data etc,,,/ archive any errors...)

hth
0
 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 250 total points
ID: 34913003
Hi Kim,

Do you need a solution using SSIS?  that would be the easiest and the fastest way.
Please let me know, I could help in that..

Jason

0
 

Author Closing Comment

by:kimberlys777
ID: 35398114
I was able to come up with a work-around
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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