Hi @在良 方
View is a virtual table. While stored procedure is a collection of sql statements and most time include parameters.
When you define a view, you can include only Select statement. See: CREATE VIEW (Transact-SQL).
In my opinion, there is no meaning in converting stored procedure to view.
How do I convert a stored procedure with parameters into a view
Maybe sometimes you can transform procedure code into a single Select in unobvious ways, but this is always very case-specific. For better support, you'd better post your stored procedure code.
Consider that you have parameters within the SP, I don't think it's possible to convert this SP to a view since we can't declare parameters when defining a view.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.