UFN_ORGANIZATIONHIERARCHYMYTEAM_GETNAME
Return
Return Type |
---|
nvarchar(100) |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_ORGANIZATIONHIERARCHYMYTEAM_GETNAME
(
@ID uniqueidentifier
)
returns nvarchar(100)
with execute as caller
as
begin
if @ID = '00000000-0000-0000-0000-000000000001'
return 'My team - Direct reports only';
if @ID = '00000000-0000-0000-0000-000000000002'
return 'My team - Including indirect reports';
declare @NAME nvarchar(100);
select @NAME = NAME from dbo.IDSETREGISTER where ID = @ID
return coalesce(@NAME, '');
end