UFN_SITECONTENT_IN_MULTI_USE
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @CONTENTID | int | IN | |
| @INCLUDETEMPLATES | bit | IN |
Definition
Copy
create function [dbo].[UFN_SITECONTENT_IN_MULTI_USE](@CONTENTID int, @INCLUDETEMPLATES bit)
returns bit
with execute as caller
as begin
declare @MULTIPLEUSES bit = 0;
declare @USECOUNT int = 0;
set @USECOUNT = (
select COUNT(SiteContentID) as useCount
from PageContent PC
inner join SitePages SP on PC.SitePagesID = SP.ID
where
CASE
WHEN @INCLUDETEMPLATES = 0
then SP.IsTemplatePage
else 0
end = 0
and SiteContentID = @CONTENTID
)
if @USECOUNT > 1
set @MULTIPLEUSES = 1
return @MULTIPLEUSES
end