Saturday, March 19, 2016

Select Stored procedure in SQL SERVER


Take an instance you have a table, where you need to only display results based on a certain criteria without every time writing a SQL query.


You can use below Stored procedure for the same:

Create PROC select_display
(
@price numeric(10,2)
)
AS
BEGIN
Select Name , ORDER_STATUS , PRICE
from dbo.display_booking
where price <= @price
order by price desc;
END
GO


exec select_display '1500';


No comments:

Post a Comment