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

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Duplicate folder entriesDuplicate folder entries
Previous
 
Next
New Post
4/16/2007 5:42 AM
 

Hi,

the update from 4.4.1 to 4.5 throwed an SQL error while adding a unique index to the folder table:

System.Data.SqlClient.SqlException: CREATE UNIQUE INDEX terminated because a duplicate key was found for object name 'dbo.Folders' and index name 'IX_FolderPath'. The duplicate key value is (, Cache/).
Could not create constraint. See previous errors.
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(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)


/* Add Constraint to FolderPath */
/********************************/

IF NOT EXISTS (select * from dbo.sysobjects where id = object_id(N'dbo.[IX_FolderPath]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
BEGIN
ALTER TABLE dbo.Folders ADD CONSTRAINT
IX_FolderPath UNIQUE NONCLUSTERED
(
PortalID,
FolderPath
) ON [PRIMARY]
END

 

What would be the best solution to remove unnessecary entries?

Cheers,

Thomas


Thomas
http://www.pacificnorthwestmusic.de
 
New Post
4/16/2007 11:40 AM
 

The easiest path would be to run a query to identify the dups

SELECT Portal, FolderPath
FROM Folders
GROUP BY portal, folderpath
HAVING COUNT(*) > 1

Once you have the listing, you can delete the individual records from the database...


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/26/2007 7:43 AM
 

Removed all duplicate entries. Now the unique index has been applied correctly.

But I still don't know how the duplicate entries have been created.

Cheers,
Thomas


Thomas
http://www.pacificnorthwestmusic.de
 
New Post
4/26/2007 12:24 PM
 

I am not sure either, it appears to have been an "issue" with a previous version of the file manager, but i cannot find any documentation on this.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/26/2007 7:05 PM
 

Apoc wrote

But I still don't know how the duplicate entries have been created.

It is usually an issue from the time running a DNN 4.3.x version. Unfortunately the newly added code to check for duplicates ignores the host portal.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Duplicate folder entriesDuplicate folder entries


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