Solved

Excel VB.net SQL Look at part of a table

Posted on 2014-10-07
2
179 Views
Last Modified: 2014-10-10
Hi


I have a VB.net Excel Add-in where I would like the user to look at data in SQL tables.
The tables are a few million records each so pulling all the data through is not an option.
I want the user to be able to look at around 10000 records at a time.
What is the best way to do this? What SQL syntax would I use?
0
Comment
Question by:murbro
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40365450
If you are using Microsoft SQL Server 2012 or 2014, then I would use the OFFSET FETCH command, i.e.

Select *
From MyTable
ORDER BY MyFields
OFFSET 0 ROWS FETCH NEXT 10000 ROWS ONLY

Open in new window


Replacing the "0 ROWS" with the relevant row number you are. Please note that the ORDER BY line is compulsory when you are using OFFSET...FETCH.
0
 

Author Closing Comment

by:murbro
ID: 40373730
Thanks very much
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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

947 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

21 Experts available now in Live!

Get 1:1 Help Now