This is the only error I got updating from 5.04 to 5.05. The system seems to work ok, so not sure what to do with this one.
System.Data.SqlClient.SqlException: The multi-part identifier "{databaseOwner}{objectQualifier}Portals.PortalID" could not be bound.
The multi-part identifier "dbo.dbdnn_Portals.portalid" could not be bound.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/* script to fix issue with errorneous administratorroleid values*/
DECLARE @PortalID int
DECLARE @AdministratorRoleId int
--Iterate through each portal
DECLARE Portals_Cursor CURSOR FOR
SELECT PortalID,AdministratorRoleId
FROM {databaseOwner}[{objectQualifier}Portals]
OPEN Portals_Cursor
--get first
FETCH NEXT FROM Portals_Cursor
into @PortalID,@AdministratorRoleId
WHILE @@FETCH_STATUS = 0
BEGIN
if @AdministratorRoleId=-1 or @AdministratorRoleId not in (select roleid from {databaseOwner}[{objectQualifier}userroles] as ur inner join {databaseOwner}[{objectQualifier}userportals] as up on ur.userid=up.userid where up.portalid=@portalid)
update portals set AdministratorRoleId =
(select roleid from dbo.dbdnn_Roles as r where
r.PortalID =dbo.dbdnn_Portals.PortalID and RoleName = 'Administrators' and {databaseOwner}{objectQualifier}Portals.portalid=@portalid) where portalid=@portalid
FETCH NEXT FROM Portals_Cursor
into @PortalID, @AdministratorRoleId
END
CLOSE Portals_Cursor
Comment by Aarsys:
I corrected (all red marked) on Moderation the script for general use. Please notice that the {obejectQualifier} and {databaseOwner} must essential be used, due to respect to different database configurations. So if you provide any script make sure you have both used and not your value of both!