Solved

VB.net Excel Add-in Fastest way to validate data against a SQL database

Posted on 2014-09-24
3
440 Views
Last Modified: 2014-09-25
Hi

I have an Excel add-in (VB.net) that is used to upload data to a SQL table.
The process requires a number of checks against other SQL tables for eg machine part number
before it is uploaded. This slows things down a lot.
Is there a way to get the data to the server first (without creating additional tables) to speed
up things?
Or would it be better to pull a datatable down from SQL?
What code would I use?
Thanks
0
Comment
Question by:murbro
3 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Maybe you need to rethink about that process.
Why it's Excel doing all the work? Why not pass the hard work to SQL Server?
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
Comment Utility
>Is there a way to get the data to the server first (without creating additional tables) to speed
 up things?
A vastly better idea would be to first load the data into SQL Server using a 'staging' table, or more than one table if needed, without validations.   I usually prefix these tables ssis_ or stg_.

Then you can write and execute Stored Procedures code to perform any data validations / JOINs / whatever in the staging table, before inserting into the ultimate destination table.
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks Jim
Great answer
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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 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

12 Experts available now in Live!

Get 1:1 Help Now