Monday, March 26, 2012

Fetching of data

hi,

I would like to know that, I have three instances of the same database at three different servers and I am trying to fetch the data from the select query. "select * from table_name"

I would like to know, whether the order of rows fetched by this query will be different on different servers of sql server or the same order of rows will be fetched.

For me the output is coming different on each server database with he same query . Pls let me know, is there any default order by or it takes it randomly.

Thanks

Gaurav Gupta

By spec, the order of rows are undetermined unless you specify an order by clause. Even multiple identical queries to the same server can return rows in different orders. It may or may not occur, but the order is not guaranteed unless you ask for the data that way.

No comments:

Post a Comment