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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select statment on cursor

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2007-04-17 : 18:48:01
1)when i make a select on a table with 50,000,000 rows
with a cursor where i make just a "select * from table1"
will i always recive the same order of the rows (assuming i dont have any keys/indexes)?
2)how execlly sql server manage thhis huge data structure to handle it faster?
thnaks i nadvance
peleg


Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-04-17 : 18:53:18
quote:
Originally posted by pelegk2

1)when i make a select on a table with 50,000,000 rows
with a cursor where i make just a "select * from table1"
will i always recive the same order of the rows (assuming i dont have any keys/indexes)?



So many bells ringing..
(1) Why do you want to SELECT 50 mil rows
(2) Why cursor
(3) Why 'SELECT * FROM..'
(4) No indexes/keys?

quote:
Originally posted by pelegk2
2)how execlly sql server manage thhis huge data structure to handle it faster?



And what is it that you are trying to do?


************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2007-04-18 : 01:38:58
the table is a temo table which is built by BULK UPLOAD of a very big
sms system where data com's from files'upload to the temp table and each row is begin taken care of byu number of condistions which by them the data in the final table's is being updated.

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-04-18 : 07:14:05
quote:
Originally posted by pelegk2

1)when i make a select on a table with 50,000,000 rows
with a cursor where i make just a "select * from table1"
will i always recive the same order of the rows (assuming i dont have any keys/indexes)?
2)how execlly sql server manage thhis huge data structure to handle it faster?

1)No - irrespective of indexes and keys. There is no such thing as order in a relation - you will need to apply an order by clause to guarentee order.
2) Do you mean how can you speed up your process? You will need to provide more info about what you are doing. Not selecting * from a 50mill table into a cursor would probably be a start....
Go to Top of Page
   

- Advertisement -