SELECT FROM stored procedure?

后端 未结 4 1748
我寻月下人不归
我寻月下人不归 2020-12-22 12:22

If I have a stored proc in SQL Server 2008, I know I can run it from management studio like so:

exec rpt_myproc @include_all = 1, @start_date = \'1/1/2010\'
         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 12:46

    Are you sure it is a sproc? I've never heard or seen a usage of doing a direct select from a sproc.

    What I have seen that works and functions exactly as your code seems to be working is table-valued functions, which are functions, that can take parameters and return a "SELECT FROMable" table just like this (in essence giving you a 'parameterized' view).

提交回复
热议问题