Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Upgrading DNN P...Upgrading DNN P...Data type issue when upgrading to 07.04.00Data type issue when upgrading to 07.04.00
Previous
 
Next
New Post
2/9/2015 3:06 PM
 

Hi,

The problem I have is that LogEventID is type int in one table (EventLog) and with version 07.04.00 bigint in another table (ExceptionEvents). So the Foreign Key does not match in type:

Current Version - 07.03.04
Upgrade - Version 07.04.00
18:34 Minutes   |   25% ERROR occured - System.Data.SqlClient.SqlException (0x80131904): Column 'dbo.EventLog.LogEventID' is not the same data type as referencing column 'ExceptionEvents.LogEventID' in foreign key 'FK_ExceptionEvents_LogEventId'. Could not create constraint or index. See previous errors. at System.Data.SqlClient.SqlConnection. (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, Boolean asyncWrite) 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:59a7cee2-021b-41ea-a421-e85d9ba6b443 Error Number:1778,State:0,Class:16 IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE name = 'FK_ExceptionEvents_LogEventId' AND parent_object_id = OBJECT_ID(N'dbo.[ExceptionEvents]')) BEGIN ALTER TABLE dbo.[ExceptionEvents] WITH CHECK ADD CONSTRAINT [FK_ExceptionEvents_LogEventId] FOREIGN KEY([LogEventID]) REFERENCES dbo.[EventLog] ([LogEventID]) ON DELETE CASCADE END

I tried this:

ALTER TABLE EventLog
 ALTER COLUMN [LogEventID] bigint NOT NULL
GO

However, it is not that easy, there are errors :

Msg 5074, Level 16, State 1, Line 2
The object 'PK_EventLogMaster' is dependent on column 'LogEventID'.
Msg 5074, Level 16, State 1, Line 2
The index 'IX_EventLog_LogConfigID' is dependent on column 'LogEventID'.
Msg 4922, Level 16, State 9, Line 2
ALTER TABLE ALTER COLUMN LogEventID failed because one or more objects access this column.

So the job would be to 1. delete these keys and indexes, 2. alter to bigint and 3. recreate the keys again, right?  I don't know if I am doing something wrong during the upgrade, there are bugs in the script, or my sql server is to sensitive. I use 2014.

 

 
New Post
2/15/2015 4:26 PM
 
I have not seen similar reports - was this a standard 7.3.4 or had you ran any custom scripts (such as Sebastian Leupolds turbosql) against it first? Can you please check your database collation (i.e. run "select serverproperty('collation')")

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/15/2015 7:04 PM
 
Cathal,
I had the same issue on one of my DNN installations, it might be that earlier DNN versions were adding LogEventID with datatype int, while newer DNN installations got BigInt. This is not a result of TurboDNN, which (currently) does not modify data types (there are plans to improve the database by removing ntext etc in one of the next versions).
Fred, you would need to drop the unique key constraint, modify the database and re-add it afterwards.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/15/2015 10:05 PM
 

Yes, I just upgraded to 7.4.0 successfully thank you very much. Here is the fix (before upgrading):

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TABLE [EventLog] DROP CONSTRAINT [PK_EventLogMaster]
GO
DROP INDEX [IX_EventLog_LogConfigID] ON [EventLog]
GO
ALTER TABLE [EventLog] ALTER COLUMN [LogEventID] bigint NOT NULL
GO
ALTER TABLE [EventLog]  WITH CHECK
ADD CONSTRAINT [PK_EventLogMaster] PRIMARY KEY CLUSTERED
( [LogEventID] ASC) ON [PRIMARY]
GO
CREATE INDEX [IX_EventLog_LogConfigID] ON [EventLog]
( LogEventID ASC, LogNotificationPending  ASC, LogCreateDate  ASC)
GO

 
New Post
2/16/2015 3:46 AM
 
thanks for sharing your solution.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Upgrading DNN P...Upgrading DNN P...Data type issue when upgrading to 07.04.00Data type issue when upgrading to 07.04.00


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out