Solved

Update SQL table with Excel data

Posted on 2015-02-18
8
105 Views
Last Modified: 2015-03-18
I have an Excel spreadsheet with data that needs to be appended to and added to fields in a SQL db.  This is similar to a question with nearly the same syntax however there was no code or script in the answer other than referring to NuGet .Net.  It is ID: 27840398 asked by eseinc and answered by Gary Davis.  I'm new to useing Visual Studio and don't know where to begin.  Will I be using a CS or VB project or a different project code base?  This will be an ongoing task so creating a project that is persistent is exactly what I need.
0
Comment
Question by:gibneyt
  • 3
  • 2
8 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
You can do it directly in the SQL Server Management Studio (SSMS). Just open SSMS, connect to the target SQL Server instance and right-click on the desired database name and chose Tasks / Import Data...
TaskMenu.PNGNow you just need to follow the wizard. Simple as that.
0
 

Author Comment

by:gibneyt
Comment Utility
Not quite as simple as that I think.  I didn't explain fully.  One field in SQL, it already contains data, needs to be appended with an additional string and another field in the same table needs to be written to with a new string.  The SQL table Mfg_Part_Master has these pertinent fields:  PRTNUM_49, MPNNUM_49, MPNMFG_49, and UDFREF_49 and the spreadsheet has these pertinent fields:  PRTNUM_49, MPNNUM_49, MPNMFG_49, and [REACH Y N].  The PRTNUM_49 and MPNNUM_49 joins will give me my unique matches.  I need to append "<two spaces>(R)" to the contents of Mfg_Part_Master.MPNMFG_49 and write "RoHS/REACH 7/2014" to the field Mfg_Part_Master.UDFREF_49 where <ExcelSpreadsheet>.[REACH Y N] ='Y'.  I am fairly proficient with SQL but need help in creating the Visual Studio project that will allow me to run this process every week.
0
 

Author Comment

by:gibneyt
Comment Utility
Anybody?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
What you need it's something more elaborated than a simple column match. I'ld go for SSIS package but let's see if some Expert can help you with Visual Studio.
0
 

Author Comment

by:gibneyt
Comment Utility
@Vitor Agreed.  And thanks for the direction.
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

763 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