I tried, but no, @gbn is correct, you can't in SQL Server 2005
here is my try:
CREATE FUNCTION dbo.TestTable
(
@InputTable table (RowID int, DataValue varchar(10))
)
RETURNS
table (RowID int, DataValue varchar(10))
AS
SELECT * FROM @InputTable ORDER BY 1 DESC
RETURN
go
DECLARE @t table (RowID int, DataValue varchar(10))
INSERT INTO @t VALUES (3,'cccc')
INSERT INTO @t VALUES (2,'bbbb')
INSERT INTO @t VALUES (1,'aaaa')
select * from @t
select * from dbo.TestTable(@t)
here are the errors:
Msg 156, Level 15, State 1, Procedure TestTable, Line 3
Incorrect syntax near the keyword 'table'.
Msg 1087, Level 15, State 2, Procedure TestTable, Line 8
Must declare the table variable "@InputTable".
Msg 1087, Level 15, State 2, Line 1