I get this error too, but I don't have anything like the sql string as shown in the example above,
My getportal dbo is like this :
---------------
CREATE procedure dbo.GetPortal
@PortalId int
as
select Portals.PortalID,
Portals.PortalName,
'LogoFile' = case when Files.FileName is null then Portals.LogoFile else Files.Folder + Files.FileName end,
Portals.FooterText,
Portals.ExpiryDate,
Portals.UserRegistration,
Portals.BannerAdvertising,
Portals.AdministratorID,
Portals.Currency,
Portals.HostFee,
Portals.HostSpace,
Portals.AdministratorRoleID,
Portals.RegisteredRoleID,
Portals.Description,
Portals.KeyWords,
'BackGroundFile' = case when Files2.FileName is null then Portals.BackGroundFile else Files2.Folder + Files2.FileName end,
Portals.GUID,
Portals.PaymentProcessor,
Portals.ProcessorUserId,
Portals.ProcessorPassword,
Portals.SiteLogHistory,
Portals.SplashTabID,
Portals.HomeTabID,
Portals.LoginTabID,
Portals.UserTabID,
Portals.DefaultLanguage,
Portals.TimeZoneOffset,
Portals.AdminTabID,
Portals.HomeDirectory,
'SuperTabId' = ( select TabId from Tabs where PortalId is null and ParentId is null ),
'AdministratorRoleName' = ( select RoleName from Roles where RoleId = Portals.AdministratorRoleID ),
'RegisteredRoleName' = ( select RoleName from Roles where RoleId = Portals.RegisteredRoleID )
from Portals
left outer join Files on Portals.LogoFile = 'fileid=' + convert(varchar,Files.FileID)
left outer join Files as Files2 on Portals.BackGroundFile = 'fileid=' +convert(varchar,Files2.FileID)
where Portals.PortalId = @PortalId
------------
Driving me mad