Hola a todos y gracias de antemano por la ayuda, quiero mejorar mis reportes en fastreport.net, y para esto necesito crear una función tipo tabla y a esta pasarle un parametro tipo tabla definido por el usuario, esto se puede hacer muy bien en un store procedure
pero no logro pasarle un parametro así a una función tipo tabla y según lo que leí si debería poderse alguien sabe como se haría les dejo el codigo
USE [40PresRes2018]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Function CreaTConsec (@Id as dbo.idsconsec ReadOnly)
Return @EsquemaCuenta table
(Id bigint
)
AS
BEGIN
SET NOCOUNT ON;
declare @TablaTemp as table(
Clave nvarchar(3),
id bigint identity
);
declare @c bigint;
declare @i bigint=1;
GO
Me marca error
Msg 156, Level 15, State 1, Procedure CreaTConsec, Line 9 [Batch Start Line 9]
Incorrect syntax near the keyword 'Return'.
Msg 137, Level 15, State 2, Procedure CreaTConsec, Line 9 [Batch Start Line 9]
Must declare the scalar variable "@EsquemaCuenta".