2025-06-10 16:47:41 +02:00

18 lines
448 B
Transact-SQL

-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION [C6Mart].[getIdElab]
(
)
RETURNS int
AS
BEGIN
-- Declare the return variable here
DECLARE @ID_ELAB AS INTEGER
SELECT @ID_ELAB = ISNULL(MAX(ID_ELAB),0)
FROM C6MART.ELABORAZIONI
-- Return the result of the function
RETURN @ID_ELAB
END