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.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • 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