Table Valued function

These functions will return entire table to the calling environment.

Syntax:
CREATE FUNCTION (PARA 1 DATA TYPE………………)
RETURNS TABLE
AS
BEGIN

RETURN (SELECT STATEMENT)
END

Example : Write a function to return entire dept table
CREATE FUNCTION F3()
RETURNS TABLE
AS
BEGIN
RETURN (SELECT * FROM DEPT)
END
Share/Bookmark

No comments: