Help, right after clicking Next on "Initialize/Upgrade Database" page I get this dump. Thanks in advance for any help.
Server Error in '/' Application.
--------------------------------------------------------------------------------
FILE:
mssql/procedures.sql
ERROR:
ORDER BY items must appear in the select list if the statement contains a UNION operator.
STATEMENT:
create procedure [dbo].[yaf_forum_moderators] (@StyledNicks bit) as
BEGIN
select
ForumID = a.ForumID,
ModeratorID = a.GroupID,
ModeratorName = b.Name,
Style = '',
IsGroup=1
from
[dbo].[yaf_ForumAccess] a WITH(NOLOCK)
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) ON b.GroupID = a.GroupID
INNER JOIN [dbo].[yaf_AccessMask] c WITH(NOLOCK) ON c.AccessMaskID = a.AccessMaskID
where
(b.Flags & 1)=0 and
(c.Flags & 64)<>0
union all
select
ForumID = access.ForumID,
ModeratorID = usr.UserID,
ModeratorName = usr.Name,
Style = case(@StyledNicks)
when 1 then ISNULL((SELECT TOP 1 f.Style FROM [dbo].[yaf_UserGroup] e
join [dbo].[yaf_Group] f on f.GroupID=e.GroupID WHERE e.UserID=usr.UserID AND LEN(f.Style) > 2 ORDER BY f.SortOrder),
r.Style)
else '' end,
IsGroup=0
from
[dbo].[yaf_User] usr WITH(NOLOCK)
INNER JOIN (
select
UserID = a.UserID,
ForumID = x.ForumID,
ModeratorAccess = MAX(ModeratorAccess)
from
[dbo].[yaf_vaccessfull] as x WITH(NOLOCK)
INNER JOIN [dbo].[yaf_UserGroup] a WITH(NOLOCK) on a.UserID=x.UserID
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) on b.GroupID=a.GroupID
WHERE
ModeratorAccess <> 0 AND x.AdminGroup = 0
GROUP BY a.UserId, x.ForumID
) access ON usr.UserID = access.UserID
JOIN [dbo].[yaf_Rank] r
ON r.RankID = usr.UserID
where
access.ModeratorAccess<>0
order by
IsGroup desc,
ModeratorName asc
END
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: FILE:
mssql/procedures.sql
ERROR:
ORDER BY items must appear in the select list if the statement contains a UNION operator.
STATEMENT:
create procedure [dbo].[yaf_forum_moderators] (@StyledNicks bit) as
BEGIN
select
ForumID = a.ForumID,
ModeratorID = a.GroupID,
ModeratorName = b.Name,
Style = '',
IsGroup=1
from
[dbo].[yaf_ForumAccess] a WITH(NOLOCK)
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) ON b.GroupID = a.GroupID
INNER JOIN [dbo].[yaf_AccessMask] c WITH(NOLOCK) ON c.AccessMaskID = a.AccessMaskID
where
(b.Flags & 1)=0 and
(c.Flags & 64)<>0
union all
select
ForumID = access.ForumID,
ModeratorID = usr.UserID,
ModeratorName = usr.Name,
Style = case(@StyledNicks)
when 1 then ISNULL((SELECT TOP 1 f.Style FROM [dbo].[yaf_UserGroup] e
join [dbo].[yaf_Group] f on f.GroupID=e.GroupID WHERE e.UserID=usr.UserID AND LEN(f.Style) > 2 ORDER BY f.SortOrder),
r.Style)
else '' end,
IsGroup=0
from
[dbo].[yaf_User] usr WITH(NOLOCK)
INNER JOIN (
select
UserID = a.UserID,
ForumID = x.ForumID,
ModeratorAccess = MAX(ModeratorAccess)
from
[dbo].[yaf_vaccessfull] as x WITH(NOLOCK)
INNER JOIN [dbo].[yaf_UserGroup] a WITH(NOLOCK) on a.UserID=x.UserID
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) on b.GroupID=a.GroupID
WHERE
ModeratorAccess <> 0 AND x.AdminGroup = 0
GROUP BY a.UserId, x.ForumID
) access ON usr.UserID = access.UserID
JOIN [dbo].[yaf_Rank] r
ON r.RankID = usr.UserID
where
access.ModeratorAccess<>0
order by
IsGroup desc,
ModeratorName asc
END
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Exception: FILE:
mssql/procedures.sql
ERROR:
ORDER BY items must appear in the select list if the statement contains a UNION operator.
STATEMENT:
create procedure [dbo].[yaf_forum_moderators] (@StyledNicks bit) as
BEGIN
select
ForumID = a.ForumID,
ModeratorID = a.GroupID,
ModeratorName = b.Name,
Style = '',
IsGroup=1
from
[dbo].[yaf_ForumAccess] a WITH(NOLOCK)
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) ON b.GroupID = a.GroupID
INNER JOIN [dbo].[yaf_AccessMask] c WITH(NOLOCK) ON c.AccessMaskID = a.AccessMaskID
where
(b.Flags & 1)=0 and
(c.Flags & 64)<>0
union all
select
ForumID = access.ForumID,
ModeratorID = usr.UserID,
ModeratorName = usr.Name,
Style = case(@StyledNicks)
when 1 then ISNULL((SELECT TOP 1 f.Style FROM [dbo].[yaf_UserGroup] e
join [dbo].[yaf_Group] f on f.GroupID=e.GroupID WHERE e.UserID=usr.UserID AND LEN(f.Style) > 2 ORDER BY f.SortOrder),
r.Style)
else '' end,
IsGroup=0
from
[dbo].[yaf_User] usr WITH(NOLOCK)
INNER JOIN (
select
UserID = a.UserID,
ForumID = x.ForumID,
ModeratorAccess = MAX(ModeratorAccess)
from
[dbo].[yaf_vaccessfull] as x WITH(NOLOCK)
INNER JOIN [dbo].[yaf_UserGroup] a WITH(NOLOCK) on a.UserID=x.UserID
INNER JOIN [dbo].[yaf_Group] b WITH(NOLOCK) on b.GroupID=a.GroupID
WHERE
ModeratorAccess <> 0 AND x.AdminGroup = 0
GROUP BY a.UserId, x.ForumID
) access ON usr.UserID = access.UserID
JOIN [dbo].[yaf_Rank] r
ON r.RankID = usr.UserID
where
access.ModeratorAccess<>0
order by
IsGroup desc,
ModeratorName asc
END]
YAF.Classes.Data.LegacyDb.system_initialize_executescripts(String script, String scriptFile, Boolean useTransactions) +635
YAF.Install._default.ExecuteScript(String scriptFile, Boolean useTransactions) +243
YAF.Install._default.UpgradeDatabase(Boolean fullText) +79
YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +999
System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e) +108
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3618