Hi Evryone!!!
Where is error?
CREATE procedure {databaseOwner}{objectQualifier}GetModuleByDefinition
@PortalId int,
@FriendlyName nvarchar(128)
as
select M.ModuleID,
M.ModuleDefID,
M.ModuleTitle,
M.AllTabs,
M.IsDeleted,
M.InheritViewPermissions,
M.Header,
M.Footer,
M.StartDate,
M.EndDate,
M.PortalID,
TM.TabModuleId,
TM.TabId,
TM.PaneName,
TM.ModuleOrder,
TM.CacheTime,
TM.Alignment,
TM.Color,
TM.Border,
TM.Visibility,
TM.ContainerSrc,
TM.DisplayTitle,
TM.DisplayPrint,
TM.DisplaySyndicate,
'IconFile' = case when F.FileName is null then TM.IconFile else F.Folder + F.FileName end,
DM.*
from {objectQualifier}Modules M
inner join {objectQualifier}ModuleDefinitions MD on M.ModuleDefId = MD.ModuleDefId
inner join {objectQualifier}DesktopModules DM on MD.DesktopModuleId = DM.DesktopModuleId
left outer join {objectQualifier}TabModules TM on M.ModuleId = TM.ModuleId
left outer join {objectQualifier}Files F on TM.IconFile = 'fileid=' + convert(varchar,F.FileID)
where ((M.PortalId = @PortalId) or (M.PortalId is null and @PortalID is null))
and MD.FriendlyName = @FriendlyName
and M.IsDeleted = 0
GO