UFN_REVENUESEGMENT_MAKETABLENAME
Returns the name of the revenue segment table for a given QueryViewCatalogID.
Return
Return Type |
---|
nvarchar(51) |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@QUERYVIEWCATALOGID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.[UFN_REVENUESEGMENT_MAKETABLENAME]
(
@QUERYVIEWCATALOGID uniqueidentifier
)
returns nvarchar(51)
as
begin
declare @TABLENAME nvarchar(51);
/* If this is BBEC, and the BBEC record source, then use a special name without the guid on it */
if dbo.[UFN_MKTRECORDSOURCE_VALIDFORBBEC](@QUERYVIEWCATALOGID) = 1
set @TABLENAME = 'REVENUESEGMENT';
else
set @TABLENAME = 'REVENUESEGMENT_' + replace(cast(@QUERYVIEWCATALOGID as nvarchar(36)), '-', '_');
return @TABLENAME;
end