EmpezarEmpieza gratis

EXECUTE con OUTPUT y valor de retorno

Almacena y muestra tanto el parámetro de salida como el código de retorno al ejecutar el SP dbo.cuspRideSummaryDelete.

Este ejercicio forma parte del curso

Escritura de funciones y procedimientos almacenados en SQL Server

Ver curso

Instrucciones del ejercicio

  • Crea variables enteras llamadas @ReturnStatus y @RowCount.
  • Pasa '3/1/2018' como valor de @DateParm y ejecuta el SP dbo.cuspRideSummaryDelete.
  • Selecciona @ReturnStatus y @RowCount para entender el impacto del SP.

ejercicio interactivo práctico

Prueba este ejercicio completando este código de ejemplo.

-- 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';
Editar y ejecutar código