Automate scripting of DB

  • Looking to script out a DB every night as a job. 

    How can I accomplish this?

  • krypto69 - Monday, February 12, 2018 8:23 AM

    Looking to script out a DB every night as a job. 

    How can I accomplish this?

    May I ask why?
    😎

    One can use SMO with PSh or C# to do this, sounds to me like a broken release management process though.

  • You could use SqlPackage to generate a dacpac.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Script out everything, or only schema? If need to script out everything, you probably need to think about DB size, the space requirement and the duration.

    GASQL.com - Focus on Database and Cloud

  • krypto69 - Monday, February 12, 2018 8:23 AM

    Looking to script out a DB every night as a job. 

    How can I accomplish this?

    We need to plan the below ones,

    Firstly we need to automate the schema of the DB objects to auto create into TARGET DB.

    To write a function to check on both the source and destination.

    Once you've set up these, use SSIS / T SQL to automate the data loading.

    Many places you'd stuck and face errors, if you could share the progress here, we'd happily help you.

Viewing 5 posts - 1 through 4 (of 4 total)

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