Hola a todos,
Tengo esta funcion que no me compila alguien me puede decir porqué?
IF OBJECT_ID (N'dbo.MonitorsPossibles', N'FN') IS NOT NULL
DROP FUNCTION dbo.MonitorsPossibles;
GO
CREATE FUNCTION dbo.MonitorsPossibles(@DATAINI datetime,@DATAFI datetime)
RETURNS @taula TABLE
(
codipersonal INT
)
AS
BEGIN
if (datepart(dw,@DATAINI)=2)
begin
insert into @taula
select * from MonitorsDilluns (@dataini,@datafi)
end
else
begin
insert into @taula
select * from MonitorsDimarts (@dataini,@datafi)
end
END
GO
ERROR: The last statement included within a function must be a return
statement.
SilviaLl.
Leer las respuestas