-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Jacob Shutzman>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE dbo.cursor_sample 
	-- Add the parameters for the stored procedure here
	@aid_input smallint
AS
BEGIN
       declare @cruising smallint
       declare db_cursor cursor for
	       select dbo.Aircraft.cruisingrange
	       from dbo.Aircraft
	       where aid >@aid_input
	       order by Aircraft.aid;
       open db_cursor
	   fetch next from db_cursor into @cruising
	   while @@FETCH_STATUS = 0
	   begin
	     print @cruising 
		 fetch next from db_cursor into @cruising
       end
	   close db_cursor
	   deallocate db_cursor
END
GO
