SQL Server Defult排序顺序. [英] Sql Server Defult sort order.

查看:93
本文介绍了SQL Server Defult排序顺序.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
是否有人向我解释两台服务器的Defult排序顺序是如何不同的.

对于前.在我的测试服务器上,我尚未应用按clase订购",但该订单仍然可以(正确),但是在其他服务器上.生产服务器,如果我没有应用Order by子句,则订单不正确.将是什么原因.(该表具有聚簇索引.)

Hi all,
Does any one explain me that how the Defult sort order of the two server''s are diffrent.

For ex. on my Test server I have not applied Order by clase , Still the order is fine (correct), but on other server ex. production server the order is not correct if I have not applied Order by clause .what will be cause .(The table have the Clustered Index.)

推荐答案

由于重新索引了索引.
这是SQL Server的意外行为.
This might happen because of re-indexing the Indexes.
This is an unexpected behavior of SQL Server.


如果您未指定排序顺序,则将按照SQL Server遇到它们的顺序返回它们:这不能保证是任何特定的顺序,并且即使两个不同的数据库接收到相同的数据也可能不一致.
如果需要特定顺序的数据,请始终指定ORDER BY子句.
If you do not specify a sort order, they are returned in the order that SQL server encounters them: this is not guaranteed to be in any particular order, and may well not be consistent between two different databases, even if they receive the same data.
If you need data in a particular order, always specify the ORDER BY clause.


这篇关于SQL Server Defult排序顺序.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆