UFN_STAFFRESOURCE_QUANTITYVALID
This function validates that the staff resource quantity is not greater that the quantity available.
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @VOLUNTEERTYPEID | uniqueidentifier | IN | |
| @QUANTITY | int | IN |
Definition
Copy
CREATE function dbo.UFN_STAFFRESOURCE_QUANTITYVALID
(
@VOLUNTEERTYPEID uniqueidentifier,
@QUANTITY int
)
returns bit
with execute as caller
as begin
declare @RETVAL bit = 0;
if (@QUANTITY <= (select VOLUNTEERTYPE.QUANTITY from dbo.VOLUNTEERTYPE where VOLUNTEERTYPE.ID = @VOLUNTEERTYPEID))
set @RETVAL = 1;
return @RETVAL;
end