Auto-generate SQL Script for entire DB?

  • I know how to manually GENERATE SQL Script for all objects in a Database (using E/M, right mouse-clicking a DB, Generate SQL Script, then checkmarking all boxes, etc.)

    Is there a way to accomplish this automatically - to schedule a SQL Server Job to Automatically script all objects in a database?

    (developers want an automated, nitely mechanism to dynamically script out Database "A" -- picking up all changes to structures -- then replace Database "B" using the auto-generated Script)

    thx in advance-

    BT
  • One way to accomplish this would be to do a backup of A and restore to B.

  • Good suggestion!  Exactly what I recommended BUT the lead developer wants to build an .MSI type application whereby they can bundle all scripts together on a CD and create, via script, a target DB environment WITHOUT the data (except for some seed data which will be housed on the CD as well)  A Backup/Restore would render data in their Source DB.  He only wants a script of the objects.

    Any other ideas?

    BT

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

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