guarantee order of table valued function results

前端 未结 4 1813
予麋鹿
予麋鹿 2021-01-28 11:04

PREMISE: The application code cannot be changed. The conditions are very specific. I am looking for something off the books, a last resort workaround if you

4条回答
  •  臣服心动
    2021-01-28 11:47

    If only a single app is using the function, in this particular way as you mentioned ( so not joined/applied to another object) this should have been a sproc ! Add an oder by clause to the data returning query to receive the result set in a particular order.

    There is always a risk your fn will be used by another dev, but not in the way you intended it to be used, causing issues of all kind. Performance being the one I would be worried about.

提交回复
热议问题