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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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, 7 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