--We will now create a table valued function, which returns
the total of price filtered by a given category . Write the following code in
your query pad –
Create function fnGetProductMasters
(
@categoryId int
)
returns table
return ( select * from ProductMasters where CategoryId=@categoryId)
--The above function returns an table.
To test this function, we will write some code as shown below –
select * from dbo.fnGetProductMasters(2)
Result
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Can you answer this question?
Write Answer1 Answers