Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Gert 80 posts 286 karma points
    Jan 24, 2016 @ 21:09

    How to script umbraco 7.3.1 MS SQL database without getting errors?


    I developped an Umbraco 7.3.1 site which I want to deploy to my hoster.

    I'm trying to host my local SQL 2012 database by generating a script to create all the tables schema's and data but when I try to run the script I get a lot off errors at the end when creating foreign key constraints.

    E.g. the following script:

    ALTER TABLE [dbo].[cmsContent]  WITH CHECK ADD  CONSTRAINT [FK_cmsContent_cmsContentType_nodeId] FOREIGN KEY([contentType])

    REFERENCES [dbo].[cmsContentType] ([nodeId])

    Generates the following error:

    There are no primary or candidate keys in the referenced table 'dbo.cmsContentType' that match the referencing column list in the foreign key 'FK_cmsContent_cmsContentType_nodeId'.Msg 1750, Level 16, State 0, Line 1Could not create constraint. See previous errors.

    Is there a script I can use to generate the database without getting an error?

    I'm using Umbraco 7.3.1.

    Thanks a lot! Regards, Gert

  • Craig Noble 41 posts 584 karma points c-trib
    Jan 25, 2016 @ 00:05
    Craig Noble

    In the past, when generating the script I disable foreign key constraints

Please Sign in or register to post replies

Write your reply to: