Disable DDL Schema Checking

  • I need to export several table, view, and stored procedure definitions from one database to another.  I can right click the objects in SSMS and use the 'Script As Create To' to create a file with all of the definitions. Some of the objects are dependent on the others. What is the best order to put the definitions in?  i.e. tables, then views, then stored procedures?  Also, is there a way to disable the schema checking so the order of creation won't matter?

  • You'd generally want to go: schemas (if any other than 'dbo'); tables, from least dependent to most dependent; functions; views; stored procedures; synonyms.  [For some of those you could change the order if you needed to.]

    Generally SQL has deferred name resolution, so for most things you're OK with objects not existing yet.  I don't remember all the specific exceptions: if you run into any issues, tweak the order of creation to correct it.

    SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!

  • Well, the quick and dirty solution is to use -DskipTests, or to disable schema validation by setting spring.jpa.hibernate.ddl-auto to none and then exclude offending tests in the maven-surefire-plugin configuration.

    That being said, you should definitely configure your integration tests to run against the database you will use for production, especially since your app uses vendor-specific db features (if not for development then for your CI build at a minimum).

     

    FaceTime

    • This reply was modified 3 years, 5 months ago by  Alton_96.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply