Solved

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

Posted on 2014-09-24
3
445 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 46

Expert Comment

by:Vitor Montalvão
ID: 40343660
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
ID: 40343788
>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
ID: 40344643
Thanks Jim
Great answer
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

910 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

20 Experts available now in Live!

Get 1:1 Help Now