Why use Select Top 100 Percent?

后端 未结 10 2314
花落未央
花落未央 2020-11-27 15:41

I understand that prior to SQL Server 2005, you could \"trick\" SQL Server to allow use of an order by in a view definition, by also include TOP 100 PERCENT

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 16:17

    I have seen other code which I have inherited which uses SELECT TOP 100 PERCENT

    The reason for this is simple: Enterprise Manager used to try to be helpful and format your code to include this for you. There was no point ever trying to remove it as it didn't really hurt anything and the next time you went to change it EM would insert it again.

提交回复
热议问题