Solved

How do I append a SQL table with an excel worksheet

Posted on 2011-02-11
3
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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