CommencerCommencez gratuitement

EXECUTE with OUTPUT & return value

Store and display both the output parameter and return code when executing dbo.cuspRideSummaryDelete SP.

Cet exercice fait partie du cours

<cours>Writing Functions and Stored Procedures in SQL Server</cours>
Voir le cours

Instructions de l’exercice

  • Create integer variables named @ReturnStatus and @RowCount.
  • Pass '3/1/2018' as the @DateParm value and execute dbo.cuspRideSummaryDelete SP.
  • Select @ReturnStatus and @RowCount to understand the impact of the SP.

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

-- Create @ReturnStatus
___ ___ AS ___
-- Create @RowCount
___ ___ AS ___

-- Execute the SP, storing the result in @ReturnStatus
___ ___ = ___.___ 
    -- Specify @DateParm
	___ = '3/1/2018',
    -- Specify RowCountOut
	@RowCountOut = @RowCount OUTPUT

-- Select the columns of interest
___
	___ AS ReturnStatus,
    ___ AS 'RowCount';
Modifier et exécuter le code