Can a view return multiple result sets?
I would like to have a view that I could run return multiple result sets. Is this possible开发者_如何学C?
If a view can not do this, then is there another object with High Visibility/Transparency within SQL Server that can achieve this? (I like using a view because I can easily see it and run it under the Views folder). A stored procedure is not really ideal because I have so many.
Thanks
No it can't and I think a stored procedure is your only option here.
Maybe you could put it in a particular schema or naming convention (e.g. prefix with __
so it's sorted at the top) to make it more visible. In SSMS you can assign shortcut keys to run particular stored procedures - does that help?
Obviously if the result sets happen to be UNION
compatible you could combine them in A View but that still only returns a single result set.
精彩评论