Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 9, 2015 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/68b47be3ad2b9cee3be3 to your computer and use it in GitHub Desktop.
Save Fhernd/68b47be3ad2b9cee3be3 to your computer and use it in GitHub Desktop.
Uso de return con valor de retorno.
-- OrtizOL - xCSw - http://ortizol.blogspot.com
CREATE PROCEDURE ReporteLightBlue AS
IF NOT EXISTS
(SELECT ProductID
FROM Production.Product
WHERE Color = 'lightblue')
BEGIN
-- Retorna 0 para indicar que no existen productos de color lightblue:
RETURN 0;
END;
DECLARE @ValorResultado int;
EXEC @ValorResultado = ReporteLightBlue;
PRINT @ValorResultado;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment