在SQL中table valued
功能为什么不能我们写里面begin
SQL语句和end
标签喜欢 -SQL用户定义的函数
create function dbo.emptable()
returns Table
as
BEGIN --it throws an error
return (select id, name, salary from employee)
END
go
而在scalar valued
功能,我们可以使用这些标签,如
create function dbo.countemp()
returns int
as
begin
return (select count(*) from employee)
end
go
有什么具体的规则我们应该使用BEGIN & END
标签