0

We can generate the scripts for all database objects manually but I want to automate this process. Is there anyway to generate scripts at a specific interval of time or can we set a job to execute to generate scripts in SQL Server 2012?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Azeem Hafeez
  • 250
  • 4
  • 14
  • 1
    Please explain what kind of script you would like to automate? DDL or DML? Or both? –  Jul 15 '19 at 09:46
  • OT - [dba](https://dba.stackexchange.com/) would be a better fit. – SMor Jul 15 '19 at 09:53
  • Possible duplicate of https://stackoverflow.com/questions/19434545/how-to-generate-sql-scripts-using-smo-scripter. The PowerShell script can be scheduled via a SQL Agent job. – Dan Guzman Jul 15 '19 at 10:12
  • You can use `SqlPackage.EXE` to generate a .dacpac if that is acceptable. Like any command line tool it can be scheduled in SQL Agent. – Nick.Mc Jul 15 '19 at 10:14

0 Answers0