观看次数:
create view EMP as
select e.EmployeeID, e.FirstName from Employees e
功能:
CREATE FUNCTION dbo.EMP2() RETURNS TABLE as
RETURN (select e.EmployeeID, e.FirstName from Employees e)
用法:
select * from EMP
select * from dbo.EMP2()
我是否应该出于任何原因使用一个?视图似乎更易于使用。