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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogBlog 4.1.0 Install Sql Script Error - Constraint does not belong to table Blog_BlogsBlog 4.1.0 Install Sql Script Error - Constraint does not belong to table Blog_Blogs
Previous
 
Next
New Post
6/8/2011 9:24 PM
 
While installing the DNN BLog 4.1 today, I ran across this Sql Error:















System.Data.SqlClient.SqlException: Constraint 'DF_dnn_Forum_Posts_ParseInfo' does not belong to table 'dnn_Blog_Blogs'. Could not drop constraint. See previous errors. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection)







...







DotNetNuke.Data.SqlDataProvider.ExecuteScript(String ConnectionString, String Script) DECLARE @defname VARCHAR(100), @cmd VARCHAR(1000) SELECT @defname = sc.name FROM sys.columns st JOIN sys.default_constraints sc ON st.column_id = sc.parent_column_id WHERE st.name = 'EnableTwitterIntegration' SET @cmd = 'ALTER TABLE dbo.dnn_Blog_Blogs DROP CONSTRAINT ' + @defname EXEC(@cmd)















This error occurs because of a bad join in the start of the 4.1 sql script, which joins up random columns and constraints in the database, and tries to drop constraints that aren't on the dnn_Blog_Blogs table.















After a bit of examination, I worked out the fix.















1. If you have installed the module and received this error - the module will still be installed, so you need to fix the script manually.







2. Find the 04.01.00.SqlDataProvider file from the blog install package.  YOu will need to unzip the install package to get this file







3. Open up this file in notepad or other text editor







4. Go to your host->sql page







5. Fix up the script, by finding this section:















SELECT @defname = sc.name







FROM sys.columns st JOIN sys.default_constraints sc







ON st.column_id = sc.parent_column_id







WHERE st.name = 'EnableTwitterIntegration'















and replace it with this Sql instead (copy paste and overwrite above section only)















SELECT @defName = sc.name







FROM sys.columns st JOIN sys.default_constraints sc







ON st.column_id = sc.parent_column_id







inner join sys.objects so







 on sc.parent_object_Id = so.object_id







WHERE so.Name = '{objectQualifier}Blog_BLogs'







 and st.Name = 'EnableTwitterIntegration'















6. Copy/Paste the entire contents on the 04.01.00.SqlDataProvider (including your fix) into the host->sql window







7. Check the 'execute as script' box







8. Click the execute link.















If all has gone well, your script will run without issue.







 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogBlog 4.1.0 Install Sql Script Error - Constraint does not belong to table Blog_BlogsBlog 4.1.0 Install Sql Script Error - Constraint does not belong to table Blog_Blogs


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