I found the problem with the failing upgrade.
As I said earlier I was already using dotnet4, i have 2,3,3.5 and four in add/remove programs
I tried the upgrade to 5.3.1 and had the same problem as in the original post
I had a could not insert duplicate key error during the sql upgrade
when I looked in the host settings/portals page I found two portals which had no title
I renamed them dnn5 and rclimo and the site started working
I ran the upgrade to 5.4.4 still had the same problem so I checked the protals again this time there were
two portals named DNN5 so I have renamed one DNN5-Coffsdotcom and the other rclimousines and the site is working correctly again
the failed sql log is below
maybe you can see what I need to do to have an error fre upgrade to 5.5 when it is released
it is 5.04.00.log.resources
System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
Violation of PRIMARY KEY constraint 'PK_dnn5_TabModuleSettings'. Cannot insert duplicate key in object 'dbo.dnn5_TabModuleSettings'.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
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()
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)
/************************************************************/
/***** SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for dbo. and dnn5_ *****/
/***** *****/
/************************************************************/
/* Initialize HideAdminBorder setting for modules under the Admin and Host tabs */
/*************************************************/
DECLARE @TabModuleID int
DECLARE CursorQuery CURSOR FOR
SELECT TabModuleID
FROM dbo.dnn5_TabModules
WHERE (TabID IN(SELECT TabID
FROM dbo.dnn5_Tabs
WHERE (TabID IN(SELECT AdminTabId FROM dbo.dnn5_vw_Portals)) OR
(ParentId IN(SELECT AdminTabId FROM dbo.dnn5_vw_Portals AS vw_Portals_1)) OR (PortalID IS NULL)))
OPEN CursorQuery
---Perform fetch
FETCH NEXT FROM CursorQuery
INTO @TabModuleID
-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN
-- now insert the id from the main table into the related table.
-- hard code values for now for some options.
-- This is executed as long as the previous fetch succeeds.
INSERT INTO dbo.dnn5_TabModuleSettings (
TabModuleId,
SettingName,
SettingValue,
CreatedByUserID,
CreatedOnDate,
LastModifiedByUserId,
LastModifiedOnDate
) VALUES (
@TabModuleID,
'hideadminborder',
'True',
-1,
GetDate(),
-1,
GetDate())
FETCH NEXT FROM CursorQuery
INTO @TabModuleID
END
CLOSE CursorQuery
DEALLOCATE CursorQuery
/* Add RegisterTabId to PortalLocalization Table */
/*************************************************/
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME='dnn5_PortalLocalization' AND COLUMN_NAME='RegisterTabId')
BEGIN
-- Add new RegisterTabId Column
ALTER TABLE dbo.dnn5_PortalLocalization
ADD RegisterTabId int NULL
END
System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'FK_dnn5_ContentItems_Tags_dnn5_ContentItems' in the database.
Could not create constraint. See previous errors.
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()
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)
/* Add Missing Foreign Keys For ContentItems_Tags */
/**************************************************/
ALTER TABLE dbo.[dnn5_ContentItems_Tags] WITH CHECK
ADD CONSTRAINT [FK_dnn5_ContentItems_Tags_dnn5_ContentItems] FOREIGN KEY([ContentItemID]) REFERENCES dbo.[dnn5_ContentItems] ([ContentItemID]) ON UPDATE CASCADE ON DELETE CASCADE
ALTER TABLE dbo.[dnn5_ContentItems_Tags] WITH CHECK
ADD CONSTRAINT [FK_dnn5_ContentItems_Tags_dnn5_Taxonomy_Terms] FOREIGN KEY([TermID]) REFERENCES dbo.[dnn5_Taxonomy_Terms] ([TermID]) ON UPDATE CASCADE ON DELETE CASCADE
System.Data.SqlClient.SqlException (0x80131904): The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_dnn5_PortalLocalization_dnn5_Portals". The conflict occurred in database "DNN5", table "dbo.dnn5_Portals", column 'PortalID'.
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()
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)
/* Add Foreign Key to PortalLocalization Table */
/***********************************************/
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'FK_dnn5_PortalLocalization_dnn5_Portals') AND OBJECTPROPERTY(id, N'IsForeignKey') = 1)
BEGIN
/* add key and cascade delete rule */
ALTER TABLE dbo.dnn5_PortalLocalization
ADD CONSTRAINT FK_dnn5_PortalLocalization_dnn5_Portals
FOREIGN KEY ( PortalID ) REFERENCES dbo.dnn5_Portals ( PortalID ) ON DELETE CASCADE
END