I have a project in which I have to interact with two databases.
One, the main and a second one who contains identities and rights of users..
So I made a view in the main with informations I need from the second one, very practical!
A Colleague this morning says to me that is more speedy and powerful (For the return) to use stored procedure in which I aim the second database directly without the view step.
Is it really the case? views are really practical because of the retrieve only data’s I need but if perf’s are not the same I will change for stored procedures..
Thanks for all answers..
NO, this seems completely incorrect.
The view can easily be used to join in other selects, where as with the stored procedure you will first have to insert the results into a temp/variable table.
Stored Procedures are as they are called used for more procedural coding.