UFN_EVENTRESOURCE_GETRESOURCESTRING
Creates a string of all the resources used in an event.
Return
Return Type |
---|
nvarchar(500) |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_EVENTRESOURCE_GETRESOURCESTRING
(
@EVENTID uniqueidentifier
)
returns nvarchar(500)
with execute as caller
as begin
declare @RESOURCES nvarchar(500);
set @RESOURCES = stuff((select '; ' + RESOURCE.NAME + ': '
+ CASE WHEN RESOURCE.ISPERTICKETITEM <> 1 THEN cast(EVENTRESOURCE.QUANTITYNEEDED as nvarchar(50))
ELSE cast(EVENTRESOURCE.PERTICKETQUANTITY as nvarchar(50)) + ' per ticket'
END
from EVENTRESOURCE
inner join RESOURCE
on EVENTRESOURCE.RESOURCEID = RESOURCE.ID
where EVENTRESOURCE.EVENTID = @EVENTID
for XML PATH('')),1, 2, '')
return @RESOURCES
end