CREATE FUNCTION dbo.GetInfo(@CustomerID int)returns @userTable table -- Defines format of the table to be returned.(ID int not null,name nvarchar(20) not null)ASBEGINDECLARE@ID int,@CName nvarchar(20)SELECT @ID= id, @CName = name from myTable where id=@CustomerID;INSERT @userTable SELECT @ID, @CName;RETURN;-- It cannot have any arguments. Once it is called, returns all rows in table variableEND;--Procedure to call itGOSELECT ID,name from dbo.GetInfo(100);GO