I have SQL2005 (on GoDaddy, and can send you the screenshot showing this)
I get this error also.
System.Data.SqlClient.SqlException: Invalid column name 'LogEventID'.
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)
CREATE PROCEDURE dbo.PurgeEventLog
AS
;WITH logcounts AS
(
SELECT
LogEventID,
LogConfigID,
ROW_NUMBER() OVER(PARTITION BY LogConfigID ORDER BY LogCreateDate DESC) AS logEventSequence
FROM dbo.EventLog
)
DELETE dbo.EventLog
FROM dbo.EventLog el
JOIN logcounts lc ON el.LogEventID = lc.LogEventID
INNER JOIN dbo.EventLogConfig elc ON elc.ID = lc.LogConfigID
WHERE elc.KeepMostRecent <> -1
AND lc.logEventSequence > elc.KeepMostRecent
I just looked at the query that is trying to execute, it is trying to a join on EventLog.LogEventID which does not exist. The closest thing that exists is: EventLog.LogGUID
The EventLog table contains columns called, LogGUID, LogTypeKey, LogConfigID, LogUserID, LogUserName, LogPortalID, LogPortalName, LogCreateDate, LogServerName, LogProperties, and LogNotificationPending. There is an index on PK_EventLogMaster which uses the column LogGUID.
In addition there does not appear to be any such table as "logcounts"