自定义的函数: create function GetAdminInfo(@id int)
returns varchar(50)
as
begin
declare @name varchar(50)
select @name=(select B.管理员名称 from 场馆信息 A inner join 管理员信息 B
on A.管理员编号=B.管理员编号 where 场馆编号=@id)
return @name
end
use 体育场管理系统调用: select dbo.getAdmininfo(1001) as 管理员名称提示的出错信息: 消息 208,级别 16,状态 1,第 1 行
对象名 '场馆信息A' 无效。
returns varchar(50)
as
begin
declare @name varchar(50)
select @name=(select B.管理员名称 from 场馆信息 A inner join 管理员信息 B
on A.管理员编号=B.管理员编号 where 场馆编号=@id)
return @name
end
use 体育场管理系统调用: select dbo.getAdmininfo(1001) as 管理员名称提示的出错信息: 消息 208,级别 16,状态 1,第 1 行
对象名 '场馆信息A' 无效。
错误提示中
对象名 '场馆信息A' 无效。
把场馆信息A当表名使用了,中间的空格呢?