Home All Groups Group Topic Archive Search About

Generate Scripts...

Author
4 Apr 2007 1:16 PM
Terry Holland
From SQL Server Management Studio, I can right click a database, select
Generate Scripts.. and then navigate through a wizard to script my database
objects. 

Is it possible to schedule such an activity?  I'd like to set up a schedule
to script all my database objects on a regular basis

tia

Terry Holland

Author
4 Apr 2007 1:31 PM
Hari Prasad
Hello,

You will have to use SQL DMO object using sp_OA* extended stored procedures.
Take a look into below URL for details.

http://www.databasejournal.com/features/mssql/article.php/2205291

Thanks
Hari

Show quote
"Terry Holland" <MSDNNospam248@nospam.nospam> wrote in message
news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@microsoft.com...
> From SQL Server Management Studio, I can right click a database, select
> Generate Scripts.. and then navigate through a wizard to script my
> database
> objects.
>
> Is it possible to schedule such an activity?  I'd like to set up a
> schedule
> to script all my database objects on a regular basis
>
> tia
>
> Terry Holland
Author
4 Apr 2007 11:08 PM
Jesse
You could also have a look here:  http://www.elsasoft.org/tools.htm

there you will find a console app that will generate scripts for all
objects in any 2000 or 2005 database.  it would be a simple matter to
schedule it to run every day using either Agent or a scheduled task in
windows.


Show quote
On Apr 4, 6:31 am, "Hari Prasad" <hari_prasa***@hotmail.com> wrote:
> Hello,
>
> You will have to use SQL DMO object using sp_OA* extended stored procedures.
> Take a look into below URL for details.
>
> http://www.databasejournal.com/features/mssql/article.php/2205291
>
> Thanks
> Hari
>
> "Terry Holland" <MSDNNospam...@nospam.nospam> wrote in message
>
> news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@microsoft.com...
>
> > From SQL Server Management Studio, I can right click a database, select
> > Generate Scripts.. and then navigate through a wizard to script my
> > database
> > objects.
>
> > Is it possible to schedule such an activity?  I'd like to set up a
> > schedule
> > to script all my database objects on a regular basis
>
> > tia
>
> > Terry Holland
Author
4 Apr 2007 1:32 PM
Aaron Bertrand [SQL Server MVP]
Well, you could grab the script it runs using Profiler, and then create a
job that runs the same script.

Or you could just archive backups of the database at the same interval,
assuming size / disk space is not an issue.

Show quote
"Terry Holland" <MSDNNospam248@nospam.nospam> wrote in message
news:BBDE32F9-FC8F-48CE-9072-AF0BF23F23A0@microsoft.com...
> From SQL Server Management Studio, I can right click a database, select
> Generate Scripts.. and then navigate through a wizard to script my
> database
> objects.
>
> Is it possible to schedule such an activity?  I'd like to set up a
> schedule
> to script all my database objects on a regular basis
>
> tia
>
> Terry Holland
Author
5 Apr 2007 10:38 AM
Erland Sommarskog
Aaron Bertrand [SQL Server MVP] (ten.xoc@dnartreb.noraa) writes:
> Well, you could grab the script it runs using Profiler, and then create a
> job that runs the same script.

I don't think that would work, since there may be different objects from
day to day.

I would guess the best bet is to see what Integration Services can do. The
script wizard does not use SSIS, but the Copy Database Wizard do, and it
also scripts the database. (Nevermind that CDW is quite flaky.)

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button