1
this is my code and wanted to add a value to a select statement that is passed by parameter to a simple table Valued function. Here is my code:
CREATE FUNCTION NMELHORESFORNECEDORES(@N INT )
RETURNS TABLE
AS
RETURN SELECT TOP @N/*da erro nesta variavel*/ IDFornecedor AS FORNECEDOR, Nome,TotalFactura FROM Fornecedores
JOIN Facturas ON Facturas.Fornecedor=Fornecedores.IDFornecedor
ORDER BY Nome DESC
the error is in the @N variable in the statement SELECT after RETURN, I cannot concatenate the value with the statement at all. how can I do??