Showing posts with label Microsoft SQL Stored Procedure. Show all posts
Showing posts with label Microsoft SQL Stored Procedure. Show all posts

Tuesday, 27 February 2018

Microsoft SQL Stored Procedure

Microsoft SQL Stored Procedure

--stored procedure with input parameters

create procedure CallDirection(@product varchar(10))
as
begin
SELECT [Product]
      ,[Low]
      ,[High]
      ,[Close]
      ,[Previous]
      ,[Direction]
  FROM [test].[dbo].[options ftse]
  where @product=Product
end;


--execute the stored procedure with a product value inputted

execute CallDirection '01/02/18';

Inline image 1