Schema owned by a role - Deployment Error

ohmohm Posts: 2
edited June 6, 2012 2:49PM in SQL Compare Previous Versions
When trying to deploy a database with SQL Compare to a new database and the source database contains a schema that is owned by a role an error can occur.

The way deployment scripts are ordered schemas are created before roles, so in the case of the above the following error will occur:
[15151] Cannot find the user 'TEST_SCHEMA', because it does not exist or you do not have permission.
CREATE SCHEMA failed due to previous errors.

The following SQL command caused the error:

CREATE SCHEMA [TEST_SCHEMA]
AUTHORIZATION [TEST_SCHEMA]

This is obviously because your role hasn't yet had the chance to be deployed and hence your script will fail. Editing the script manually to create the role before said schema will allow the deployment through without fault.

Can the developers please check for schemas owned by roles and rearrange how the deployment scripts are created for these cases?

Thanks!

Comments

  • Eddie DEddie D Posts: 1,802 Rose Gold 5
    Hi Ohm

    Thank you for your post into the forum.

    I have added the details of this forum post to an existing Bug Report reference SC-5584. We hope to have a fix for this particular bug in the next version SQL Compare V10.2. Sadly I do not have a release date at this time.

    I will update this forum post when I receive further information.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Eddie DEddie D Posts: 1,802 Rose Gold 5
    Hi Ohm

    Quick update for you. Sadly your bug SC-5584, did not make into SQL Compare V10.2 released earlier today. I am sorry if I raised your expectations on fixing this problem.

    Hopefully this bug will be fixed in the near future.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Eddie DEddie D Posts: 1,802 Rose Gold 5
    Hi Ohm

    You will be please to know that the bug you reported to us in this forum thread which resulted in Bug report SC-5584 has now been resolved in SQL Compare V10.2.0.916.

    Please use this LINK to download.

    Can you please download and upgrade to confirm that this problem is resolved in your environment.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.