Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting records

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2010-01-09 : 04:05:54
Dears,

I have a table with 100 records. I need to select first 10 records then store in an array. Again select next 10 records then store in an array and so on...
Here storing to an array i can do it by using ASP.

How i can write such a query. I am using SQL 2005 server.
I need only that SQL query.

thanks
Shaji

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2010-01-09 : 06:30:07
Hi,

Why you need like this??
You can read all the records in a recordset an you can store them in seperate arrays as you like (ie.10 by 10) through ASP.
If you can write your real scenario i can suggest you.

Regards,
Sathieshkumar. R
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-01-09 : 06:43:59
Do you mean pagination?

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2010-01-09 : 08:04:23
Thanks mr. Sathieshkumar. R,

My requirement is, I have a table with two fields. 1 - Id, 2 - MobileNumber. I need to take first 10 MobileNumbers then send these 10 MobileNumbers through http request. Here the http will allow only 10 mobile numbers at a time. Next again select 10 MobileNumbers then send through http and so on... until all the MobileNumbers finish

This is whats my scenario. I hope you can help me on this!

regards
Shaji


quote:
Originally posted by sathiesh2005

Hi,

Why you need like this??
You can read all the records in a recordset an you can store them in seperate arrays as you like (ie.10 by 10) through ASP.
If you can write your real scenario i can suggest you.

Regards,
Sathieshkumar. R

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-01-09 : 08:33:33
This may help:
http://www.asp101.com/samples/db_paging.asp

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-09 : 10:05:52
Like Sathieshkumar. R posted:
Select all values into your array and do the loop with each 10 entries on your array.
There is no need to solve this problem in your sql statement.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-09 : 10:09:00
quote:
Originally posted by shajimanjeri

Thanks mr. Sathieshkumar. R,

My requirement is, I have a table with two fields. 1 - Id, 2 - MobileNumber. I need to take first 10 MobileNumbers then send these 10 MobileNumbers through http request. Here the http will allow only 10 mobile numbers at a time. Next again select 10 MobileNumbers then send through http and so on... until all the MobileNumbers finish

This is whats my scenario. I hope you can help me on this!

regards
Shaji


quote:
Originally posted by sathiesh2005

Hi,

Why you need like this??
You can read all the records in a recordset an you can store them in seperate arrays as you like (ie.10 by 10) through ASP.
If you can write your real scenario i can suggest you.

Regards,
Sathieshkumar. R




are you trying to schedule this periodically?
Go to Top of Page
   

- Advertisement -