I am new to this stored procedures my question is related to cursor output parameter. what is the difference between cursor output parameter and a normal stored procedure like it just a variable or it effect the result or performance of query?
I am using SQL Server 2014. Creating a stored procedure I used the shortcut key alt+k, alt+x. in the list I have selected stored procedure after selecting the stored procedure, it ask to choose stored procedure type:
- Create procedure basic template
- Create procedure with cursor output parameter
- Create procedure with output parameter.
I couldn't understand the 2nd stored procedure type. I tried to google but didn't get sufficient information. Anyone here to help me to understand will much appreciated. I have attached the 2nd stored procedure type sample script
CREATE PROCEDURE dbo.Sample_Procedure
@sample_procedure_cursor CURSOR VARYING OUTPUT
AS
SET @sample_procedure_cursor = CURSOR FOR
select 1
OPEN @sample_procedure_cursor
RETURN 0
I just want to understand is there any other output I can't see using "cursor varying output" keywords instead of using "@variable datatype;"