I have a stored proc that performs a fairly complex SELECT statement. The stored proc accepts to params which are used in the query:
ALTER PROCEDURE [dbo].[GetConnections]
@equipmentId int,
@equipmentPortNum int
AS
SELECT ..SELECT QUERY HERE..
END
I'm considering changing this to a view, and just filtering the view when I call it:
SELECT * from ConnectionsView Where EquipmentID = XXX and EquipmentPortNum = YYY
My question is: Is there any advantage of one over the other - esp wrt performance?
Since I will be calling the view from an ORM, the query will have parametised filter options and result in a cached execution plan, meaning (unless I'm wrong) that the stored proc won't be any more performant over the view - is this correct?