Statements execution order for Deployment script

First of all,
Wishing to all of you a joyful New Year.

My source script folder contains table A. The target source script contains table A_sys and A_trxn tables. Table A contained system  and transactional data was split into two tables. Finally , target source script contains a view  named A based on A_sys and A_trxn.  Schema compare creates first the view named A (I am getting an error due to the fact the object exists (table A) and finally created the statement for dropping the table A.
Is there any way of changing the ordering of the above statements?

Regards 


Tagged:

Answers

  • Eddie DEddie D Posts: 1,803 Rose Gold 5
    Hi Nikos74,
    Happy New Year to you.

    The deployment process will generate the deployment script in dependency order, for example creating a view after it has created the dependent table or tables.  However the dependency process can get this incorrect, particularly when reading from script files, as it is more difficult to obtain the dependencies between objects when reading from a scripts folder compared to a live database schema

    In the example you provided, View A exists in both source and target.  The deployment process will be looking to modify View A, so that the target DDL dependent on Tables A_sys and A_trxn would be changed to match the source DDL which has dependency to table A.  So would need to create scripts file for table A and then modify the scripts file for View A.

    Tables A_sys and A_trxn only exist in the target these two tables would dropped or removed from the scripts folder.

    When reviewing the comparison results, is View A listed as existing in both but different?  Or are the object listed only as existing in their own schema?

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