UFN_PERFORMANCECATEGORYLEVEL_HASONEORFEWERALLTRANSLATIONTABLE
Returns the number of grade records set to All Translation Tables for a Performance Category Level.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PERFORMANCECATEGORYLEVELID | uniqueidentifier | IN | |
@TRANSLATIONTABLEID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_PERFORMANCECATEGORYLEVEL_HASONEORFEWERALLTRANSLATIONTABLE(
@PERFORMANCECATEGORYLEVELID uniqueidentifier,
@TRANSLATIONTABLEID uniqueidentifier
)
returns bit
with execute as caller
as begin
-- has no 'all translation table' rows
if not exists (
select
ID
from
dbo.PERFORMANCECATEGORYLEVELGRADE
where
PERFORMANCECATEGORYLEVELID = @PERFORMANCECATEGORYLEVELID
and TRANSLATIONTABLEID is null
)
return -1;
-- has only one row
if 1 = (
select
count(ID)
from
dbo.PERFORMANCECATEGORYLEVELGRADE
where
PERFORMANCECATEGORYLEVELID = @PERFORMANCECATEGORYLEVELID
)
return -1;
return 0;
end