CREATE FUNCTION sumar
(@n1 as int,
@n2 as int
)
RETURNS INT
AS
BEGIN
DECLARE @r INT = 0
SET @r = @n1 + @n2
RETURN @r
END
GO
PRINT dbo.sumar(7,3)
la función queda almacenada en la carpeta "Functions", "Scalar-value Functions"
No hay comentarios.:
Publicar un comentario