Tuesday, 27 February 2018

Microsoft SQL Server Inline Table Valued Function

Microsoft SQL Server Inline Table Valued Function
--returns a table

create function returnInlineTable(@date varchar(10))
returns table
as
return (select *
FROM [test].[dbo].[options ftse]
where @date=Product);

--write the function starting with "SELECT * FROM"
--can be used with where clause and also joins

select * from dbo.returnInlineTable('01/03/18')

Inline image 1

No comments:

Post a Comment