Solved

How do I append a SQL table with an excel worksheet

Posted on 2011-02-11
3
278 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:huslayer
huslayer 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now