EdwardPeter
asked on
stored function:Invalid object name
Hi
Kindly assist how to resolved this error:
Server: Msg 208, Level 16, State 1, Procedure ufn_getorglist, Line 19
Invalid object name 'team_master'.
Thanks.
create function dbo.ufn_getorglist(@operat orid int)
returns @t table(operatorid int, supervisorID int) as
begin
declare @supervisorID int
select top 1 @supervisorID = supervisorID from
(select a.operatorid as supervisorid from operator_master a
inner join team_master b on b.teamid=a.teamid and b.supervisorid=@operatorid )z
while @@rowcount <> 0
begin
insert into @t (operatorid, supervisorID) select *, @supervisorID from dbo.ufn_GetChildNodes(@sup ervisorID) d
select top 1 @supervisoriD = supervisorID from
(select a.operatorid as supervisorid from operator_master a
inner join team_master b on b.teamid=a.teamid and b.supervisorid=@operatorid )z
where supervisorID > @supervisorID
end
return
End
Go
Kindly assist how to resolved this error:
Server: Msg 208, Level 16, State 1, Procedure ufn_getorglist, Line 19
Invalid object name 'team_master'.
Thanks.
create function dbo.ufn_getorglist(@operat
returns @t table(operatorid int, supervisorID int) as
begin
declare @supervisorID int
select top 1 @supervisorID = supervisorID from
(select a.operatorid as supervisorid from operator_master a
inner join team_master b on b.teamid=a.teamid and b.supervisorid=@operatorid
while @@rowcount <> 0
begin
insert into @t (operatorid, supervisorID) select *, @supervisorID from dbo.ufn_GetChildNodes(@sup
select top 1 @supervisoriD = supervisorID from
(select a.operatorid as supervisorid from operator_master a
inner join team_master b on b.teamid=a.teamid and b.supervisorid=@operatorid
where supervisorID > @supervisorID
end
return
End
Go
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hilaire,
Thanks so much for your time and patience.
Thanks so much for your time and patience.
select top 1 @supervisorID = supervisorID from
(select a.operatorid as supervisorid from operator_master a
inner join team_master b on b.teamid=a.teamid and b.supervisorid=@operatorid
order by supervisorID