UFN_RESERVATION_HASEMPTYITINERARY
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @RESERVATIONID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_RESERVATION_HASEMPTYITINERARY (
@RESERVATIONID uniqueidentifier
)
returns bit
with execute as caller
as begin
if exists (
select 1
from dbo.[ITINERARY]
where
[RESERVATIONID] = @RESERVATIONID and
--Itinerary has nothing
(
not exists (select 1 from dbo.[ITINERARYITEM] where [ITINERARYID] = [ITINERARY].[ID]) and
not exists (select 1 from dbo.[ITINERARYRESOURCE] where [ITINERARYID] = [ITINERARY].[ID]) and
not exists (select 1 from dbo.[ITINERARYSTAFFRESOURCE] where [ITINERARYID] = [ITINERARY].[ID])
)
)
return 1;
return 0;
end