Solved

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

Posted on 2014-09-24
3
455 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 48

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

860 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