Hello Richard,
I tried the new installation. i got first error like this, after corrected it and run on db i got the error "Skins". Is there any case to make database installation by sql scripts and skip that step?
15% ERROR occured - System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@portalid". Incorrect syntax near the keyword 'ELSE'. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:90277e70-6811-4c68-9ca1-0a66e3bec89d CREATE procedure dbo.GetTabPermissionsByPortal @PortalID int AS IF @portalid is not null BEGIN SELECT * FROM dbo.vw_TabPermissions WHERE PortalID = @PortalID END ELSE BEGIN SELECT * FROM dbo.vw_TabPermissions WHERE PortalID IS NULL END System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@id". at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:0d34ba32-155a-4e59-ab1f-29cb691318b1 CREATE PROCEDURE dbo.[Mobile_DeleteRedirection] @Id INT AS DELETE FROM dbo.Mobile_RedirectionRules WHERE RedirectionId = @id DELETE FROM dbo.Mobile_Redirections WHERE Id = @Id System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@id". at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:b74326dc-282e-49c2-9b65-da94dc13eaea CREATE PROCEDURE dbo.[Mobile_DeleteRedirectionRule] @Id INT AS DELETE FROM dbo.Mobile_RedirectionRules WHERE Id = @id System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@id". Must declare the scalar variable "@id". Must declare the scalar variable "@id". at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:9637b793-fadc-41ff-873e-4041d1b5e128 CREATE PROCEDURE dbo.[AddSearchItemWord] @SearchItemID INT, @SearchWordsID INT, @Occurrences INT AS DECLARE @ID INT SELECT @id = SearchItemWordId FROM dbo.SearchItemWord WHERE SearchItemId = @SearchItemID AND SearchWordsId = @SearchWordsID IF @ID IS NULL BEGIN INSERT INTO dbo.SearchItemWord ([SearchItemId], [SearchWordsId], [Occurrences]) VALUES (@SearchItemID, @SearchWordsID, @Occurrences) SELECT Scope_identity() END ELSE BEGIN UPDATE dbo.SearchItemWord SET Occurrences = @Occurrences WHERE SearchItemWordId = @id AND Occurrences <> @Occurrences SELECT @id END System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@AdminTabid". at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:6a76ca11-aa0f-4bab-847d-fcda9475870d CREATE PROCEDURE dbo.[UpdatePortalInfo] @PortalID int, @PortalGroupID int, @PortalName nvarchar(128), @LogoFile nvarchar(50), @FooterText nvarchar(100), @ExpiryDate datetime, @UserRegistration int, @BannerAdvertising int, @Currency char(3), @AdministratorId int, @HostFee money, @HostSpace int, @PageQuota int, @UserQuota int, @PaymentProcessor nvarchar(50), @ProcessorUserId nvarchar(50), @ProcessorPassword nvarchar(50), @Description nvarchar(500), @KeyWords nvarchar(500), @BackgroundFile nvarchar(50), @SiteLogHistory int, @SplashTabId int, @HomeTabId int, @LoginTabId int, @RegisterTabId int, @UserTabId int, @SearchTabId int, @DefaultLanguage nvarchar(10), @HomeDirectory varchar(100), @LastModifiedByUserID int, @CultureCode nvarchar(50) AS UPDATE dbo.Portals SET PortalGroupID = @PortalGroupID, ExpiryDate = @ExpiryDate, UserRegistration = @UserRegistration, BannerAdvertising = @BannerAdvertising, Currency = @Currency, AdministratorId = @AdministratorId, HostFee = @HostFee, HostSpace = @HostSpace, PageQuota = @PageQuota, UserQuota = @UserQuota, PaymentProcessor = @PaymentProcessor, ProcessorUserId = @ProcessorUserId, ProcessorPassword = @ProcessorPassword, SiteLogHistory = @SiteLogHistory, DefaultLanguage = @DefaultLanguage, HomeDirectory = @HomeDirectory, LastModifiedByUserID = @LastModifiedByUserID, LastModifiedOnDate = getdate() WHERE PortalId = @PortalID IF EXISTS (SELECT * FROM dbo.PortalLocalization WHERE PortalId = @PortalID AND CultureCode = @CultureCode) BEGIN UPDATE dbo.PortalLocalization SET PortalName = @PortalName, LogoFile = @LogoFile, FooterText = @FooterText, Description = @Description, KeyWords = @KeyWords, BackgroundFile = @BackgroundFile, HomeTabId = @HomeTabId, LoginTabId = @LoginTabId, RegisterTabId = @RegisterTabId, UserTabId = @UserTabId, SplashTabId = @SplashTabId, SearchTabId = @SearchTabId, LastModifiedByUserID = @LastModifiedByUserID, LastModifiedOnDate = getdate() WHERE PortalId = @PortalID AND CultureCode = @CultureCode END ELSE BEGIN DECLARE @AdminTabId int SET @AdminTabId = (SELECT AdminTabId FROM dbo.PortalLocalization WHERE PortalID = @PortalID AND CultureCode='en-US') INSERT INTO dbo.PortalLocalization ( [PortalID], [CultureCode], [PortalName], [LogoFile], [FooterText], [Description], [KeyWords], [BackgroundFile], [HomeTabId], [LoginTabId], [UserTabId], [AdminTabId], [SplashTabId], [SearchTabId], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate] ) VALUES ( @PortalID, @CultureCode, @PortalName, @LogoFile, @FooterText, @Description, @KeyWords, @BackgroundFile, @HomeTabId , @LoginTabId , @UserTabId, @AdminTabid, @SplashTabId , @SearchTabId, -1, getdate(), -1, getdate() ) END System.Data.SqlClient.SqlException (0x80131904): XQuery: Unable to resolve sql:variable('@userid'). The variable must be declared as a scalar TSQL variable. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:c74344ff-6322-4aca-82bc-5ecdcdcc509f CREATE PROCEDURE dbo.[Journal_Comment_Like] @JournalId int, @CommentId int, @UserId int, @UserName nvarchar(50) AS DECLARE @cxml xml SET @cxml = (SELECT CommentXML FROM dbo.[Journal_Comment] WHERE CommentId = @CommentId AND JournalId = @JournalId) IF @cxml IS NULL BEGIN DECLARE @x xml SET @x = '<root></root>'; UPDATE dbo.[Journal_Comments] SET CommentXML = @x WHERE JournalId = @JournalId AND CommentId = @CommentId END IF EXISTS(SELECT CommentId FROM dbo.[Journal_Comments] WHERE JournalId = @JournalId AND CommentId = @CommentId AND CommentXML.exist('/root/likes/u[@uid=sql:variable("@userid")]') = 1) BEGIN UPDATE dbo.[Journal_Comments] SET CommentXML.modify('delete (/root/likes/u[@uid=sql:variable("@UserId")])') WHERE JournalId = @JournalId AND CommentId = @CommentId AND journalxml.exist('/root/likes/u[@uid=sql:variable("@UserId")]') = 1 END ELSE BEGIN BEGIN IF NOT EXISTS(SELECT CommentId FROM dbo.[Journal_Comments] WHERE JournalId = @JournalId AND CommentId = @CommentID AND CommentXML.exist('/root/likes') = 1) BEGIN UPDATE dbo.[Journal_Comments] SET CommentXML.modify('insert <likes /> as last into (/root)[1]') WHERE JournalId = @JournalId AND CommentId = @CommentId AND CommentXML.exist('/root') = 1 END END BEGIN UPDATE dbo.[Journal_Comments] SET CommentXML.modify('insert <u uid="{xs:string(sql:variable("@UserId"))}" un="{xs:string(sql:variable("@UserName"))}" /> as last into (/root/likes)[1]') Where JournalId = @JournalId AND CommentId = @CommentId AND CommentXML.exist('/root/likes') = 1 END END System.Data.SqlClient.SqlException (0x80131904): XQuery: Unable to resolve sql:variable('@userid'). The variable must be declared as a scalar TSQL variable. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:e9fadbbe-09ef-4baa-941f-1746cd4f28b9 CREATE PROCEDURE dbo.[Journal_Like] @JournalId int, @UserId int, @UserName nvarchar(50) AS IF NOT EXISTS (SELECT JournalId from dbo.[Journal_Data] WHERE JournalId = @JournalId) BEGIN DECLARE @x xml SET @x = '<items><item /></items>'; INSERT INTO dbo.[Journal_Data] (JournalId, JournalXML) VALUES (@JournalId, @x) END IF EXISTS(SELECT j.JournalId FROM dbo.Journal as j INNER JOIN dbo.Journal_Data as jx ON j.JournalId = jx.JournalId WHERE j.JournalId = @JournalId AND jx.journalxml.exist('/items/likes/u[@uid=sql:variable("@userid")]') = 1) BEGIN UPDATE dbo.Journal_Data SET JournalXML.modify('delete (/items/likes/u[@uid=sql:variable("@UserId")])') WHERE JournalId = @JournalId AND journalxml.exist('/items/likes/u[@uid=sql:variable("@UserId")]') = 1 END ELSE BEGIN BEGIN IF NOT EXISTS(SELECT JournalId FROM dbo.Journal_Data WHERE JournalId = @JournalId AND journalxml.exist('/items/likes') = 1) BEGIN UPDATE dbo.Journal_Data SET JournalXML.modify('insert <likes /> as last into (/items)[1]') WHERE JournalId = @JournalId AND journalxml.exist('/items') = 1 END END BEGIN UPDATE dbo.Journal_Data SET JournalXML.modify('insert <u uid="{xs:string(sql:variable("@UserId"))}" un="{xs:string(sql:variable("@UserName"))}" /> as last into (/items/likes)[1]') Where JournalId = @JournalId AND journalxml.exist('/items/likes') = 1 END END System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'JournalId'. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:bd36704f-4caa-4f0e-a238-66add3465f28 CREATE PROCEDURE dbo.[Journal_ListForGroup] @PortalId int, @ModuleId int, @CurrentUserId int, @GroupId int, @RowIndex int, @MaxRows int AS DECLARE @EndRow int SET @EndRow = @RowIndex + @MaxRows; DECLARE @j TABLE(id int IDENTITY, journalid int, datecreated datetime) IF EXISTS(SELECT * from dbo.[Journal_TypeFilters] WHERE ModuleId = @ModuleId) INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey AND (js.SecurityKey = 'R' + CAST(@GroupId as nvarchar(100)) OR js.SecurityKey = 'E') WHERE j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId AND jt.GroupId = @GroupId INNER JOIN dbo.[Journal_TypeFilters] as jf ON jf.JournalTypeId = jt.JournalTypeId AND jf.ModuleId = @ModuleId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; ELSE INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey AND (js.SecurityKey = 'R' + CAST(@GroupId as nvarchar(100)) OR js.SecurityKey = 'E') WHERE j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId AND jt.GroupId = @GroupId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; WITH journalItems AS ( SELECT j.JournalId, ROW_NUMBER() OVER (ORDER BY j.JournalId DESC) AS RowNumber FROM dbo.[Journal] as j INNER JOIN @j as jtmp ON jtmp.JournalId = j.JournalId WHERE j.PortalId = @PortalId ) SELECT j.JournalId, j.JournalTypeId, j.Title, j.Summary, j.UserId, j.DateCreated, j.DateUpdated, j.PortalId, j.ProfileId, j.GroupId, j.ObjectKey, j.AccessKey, "JournalOwner" = '<entity><id>' + CAST(r.RoleId as nvarchar(150)) + '</id><name><![CDATA[' + r.RoleName + ']]></name></entity>', "JournalAuthor" = CASE WHEN ISNULL(a.UserId,-1) >0 THEN '<entity><id>' + CAST(a.UserId as nvarchar(150)) + '</id><name><![CDATA[' + a.DisplayName + ']]></name></entity>' ELSE '' END, "JournalOwnerId" = ISNULL(j.ProfileId,j.UserId), jt.Icon, jt.JournalType, "Profile" = CASE WHEN j.ProfileId > 0 THEN '<entity><id>' + CAST(p.UserID as nvarchar(150)) + '</id><name><![CDATA[' + p.DisplayName + ']]></name><vanity></vanity></entity>' ELSE '' END, jd.JournalXML, j.ContentItemId, j.ItemData, RowNumber FROM journalItems as ji INNER JOIN dbo.[Journal] as j ON j.JournalId = ji.JournalId INNER JOIN dbo.[Journal_Types] as jt ON jt.JournalTypeId = j.JournalTypeId INNER JOIN dbo.[Roles] as r ON j.GroupId = r.RoleId LEFT OUTER JOIN dbo.[Journal_Data] as jd on jd.JournalId = j.JournalId LEFT OUTER JOIN dbo.[Users] AS p ON j.ProfileId = p.UserID LEFT OUTER JOIN dbo.[Users] AS a ON j.UserId = a.UserID WHERE RowNumber BETWEEN @RowIndex AND @EndRow ORDER BY RowNumber ASC; System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'JournalId'. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:f241b5b9-32ad-4f86-b783-cb267ed97dcb CREATE PROCEDURE dbo.[Journal_ListForSummary] @PortalId int, @ModuleId int, @CurrentUserId int, @RowIndex int, @MaxRows int AS DECLARE @EndRow int SET @EndRow = @RowIndex + @MaxRows; DECLARE @j TABLE(id int IDENTITY, journalid int, datecreated datetime) IF EXISTS(SELECT * from dbo.[Journal_TypeFilters] WHERE ModuleId = @ModuleId) INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey WHERE j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId INNER JOIN dbo.[Journal_TypeFilters] as jf ON jf.JournalTypeId = jt.JournalTypeId AND jf.ModuleId = @ModuleId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; ELSE INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey WHERE j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; WITH journalItems AS ( SELECT j.JournalId, ROW_NUMBER() OVER (ORDER BY j.JournalId DESC) AS RowNumber FROM dbo.[Journal] as j INNER JOIN @j as jtmp ON jtmp.JournalId = j.JournalId WHERE j.PortalId = @PortalId ) SELECT j.JournalId, j.JournalTypeId, j.Title, j.Summary, j.UserId, j.DateCreated, j.DateUpdated, j.PortalId, j.ProfileId, j.GroupId, j.ObjectKey, j.AccessKey, "JournalOwner" = '<entity><id>' + CAST(p.UserId as nvarchar(150)) + '</id><name><![CDATA[' + p.DisplayName + ']]></name></entity>', "JournalAuthor" = CASE WHEN ISNULL(a.UserId,-1) >0 THEN '<entity><id>' + CAST(a.UserId as nvarchar(150)) + '</id><name><![CDATA[' + a.DisplayName + ']]></name></entity>' ELSE '' END, "JournalOwnerId" = ISNULL(j.ProfileId,j.UserId), jt.Icon, jt.JournalType, "Profile" = CASE WHEN j.ProfileId > 0 THEN '<entity><id>' + CAST(p.UserID as nvarchar(150)) + '</id><name><![CDATA[' + p.DisplayName + ']]></name><vanity></vanity></entity>' ELSE '' END, jd.JournalXML, j.ContentItemId, j.ItemData, RowNumber FROM journalItems as ji INNER JOIN dbo.[Journal] as j ON j.JournalId = ji.JournalId INNER JOIN dbo.[Journal_Types] as jt ON jt.JournalTypeId = j.JournalTypeId LEFT OUTER JOIN dbo.[Journal_Data] as jd on jd.JournalId = j.JournalId LEFT OUTER JOIN dbo.[Users] AS p ON j.ProfileId = p.UserID LEFT OUTER JOIN dbo.[Users] AS a ON j.UserId = a.UserID WHERE RowNumber BETWEEN @RowIndex AND @EndRow ORDER BY RowNumber ASC; System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'JournalId'. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:ba2735db-d55f-4fcf-933a-a0e27e316044 CREATE PROCEDURE dbo.[Journal_ListForProfile] @PortalId int, @ModuleId int, @CurrentUserId int, @ProfileId int, @RowIndex int, @MaxRows int AS DECLARE @EndRow int SET @EndRow = @RowIndex + @MaxRows; DECLARE @j TABLE(id int IDENTITY, journalid int, datecreated datetime) IF EXISTS(SELECT * from dbo.[Journal_TypeFilters] WHERE ModuleId = @ModuleId) INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey WHERE j.ProfileId = @ProfileId AND j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId INNER JOIN dbo.[Journal_TypeFilters] as jf ON jf.JournalTypeId = jt.JournalTypeId AND jf.ModuleId = @ModuleId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; ELSE INSERT INTO @j SELECT j.journalid, jt.datecreated from ( SELECT DISTINCT js.JournalId from dbo.[Journal] as j INNER JOIN dbo.[Journal_Security] as js ON js.JournalId = j.JournalId INNER JOIN dbo.[Journal_User_Permissions](@PortalId,@CurrentUserId ,1) as t ON t.seckey = js.SecurityKey WHERE j.ProfileId = @ProfileId AND j.PortalId = @PortalId ) as j INNER JOIN dbo.[Journal] jt ON jt.JournalId = j.JournalId AND jt.PortalId = @PortalId ORDER BY jt.DateCreated DESC, jt.JournalId DESC; WITH journalItems AS ( SELECT j.JournalId, ROW_NUMBER() OVER (ORDER BY j.JournalId DESC) AS RowNumber FROM dbo.[Journal] as j INNER JOIN @j as jtmp ON jtmp.JournalId = j.JournalId WHERE j.PortalId = @PortalId AND j.ProfileId = @ProfileId ) SELECT j.JournalId, j.JournalTypeId, j.Title, j.Summary, j.UserId, j.DateCreated, j.DateUpdated, j.PortalId, j.ProfileId, j.GroupId, j.ObjectKey, j.AccessKey, "JournalOwner" = '<entity><id>' + CAST(p.UserId as nvarchar(150)) + '</id><name><![CDATA[' + p.DisplayName + ']]></name></entity>', "JournalAuthor" = CASE WHEN ISNULL(a.UserId,-1) >0 THEN '<entity><id>' + CAST(a.UserId as nvarchar(150)) + '</id><name><![CDATA[' + a.DisplayName + ']]></name></entity>' ELSE '' END, "JournalOwnerId" = ISNULL(j.ProfileId,j.UserId), jt.Icon, jt.JournalType, "Profile" = CASE WHEN j.ProfileId > 0 THEN '<entity><id>' + CAST(p.UserID as nvarchar(150)) + '</id><name><![CDATA[' + p.DisplayName + ']]></name><vanity></vanity></entity>' ELSE '' END, jd.JournalXML, j.ContentItemId, j.ItemData, RowNumber FROM journalItems as ji INNER JOIN dbo.[Journal] as j ON j.JournalId = ji.JournalId INNER JOIN dbo.[Journal_Types] as jt ON jt.JournalTypeId = j.JournalTypeId LEFT OUTER JOIN dbo.[Journal_Data] as jd on jd.JournalId = j.JournalId LEFT OUTER JOIN dbo.[Users] AS p ON j.ProfileId = p.UserID LEFT OUTER JOIN dbo.[Users] AS a ON j.UserId = a.UserID WHERE RowNumber BETWEEN @RowIndex AND @EndRow ORDER BY RowNumber ASC;