Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Update SQL table with Excel data

Posted on 2015-02-18
8
Medium Priority
?
126 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 52

Expert Comment

by:Vitor Montalvão
ID: 40616598
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
ID: 40616693
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
ID: 40618957
Anybody?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 52

Accepted Solution

by:
Vitor Montalvão earned 2000 total points
ID: 40619118
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
ID: 40619123
@Vitor Agreed.  And thanks for the direction.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40672900
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

971 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