fnGetFolderID
Return
Return Type |
---|
int |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@Type | int | IN | |
@Name | nvarchar(255) | IN | |
@ParentFolderID | int | IN | |
@ClientSitesId | int | IN |
Definition
Copy
CREATE FUNCTION [dbo].[fnGetFolderID](
@Type int,
@Name nvarchar(255),
@ParentFolderID int,
@ClientSitesId int
)
RETURNS int AS
BEGIN
DECLARE @RecordID int
SET @RecordID = (SELECT TOP 1 [FolderID]
FROM [dbo].[SiteFolders]
WHERE [type] = @Type
AND [FolderName]=@Name
and [deleted] = 0
and [clientsitesid]=@ClientSitesId
and (
coalesce(ParentFolderID,0) = coalesce(@ParentFolderID,0)
)
)
if (@RecordID is null) begin
set @RecordID = 0
end
return @RecordID
END