Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Scripting Databases/Jobs 1

Status
Not open for further replies.

VILLIEIA

Programmer
Joined
Oct 18, 2001
Messages
2
Location
ZA
Is there a reasonably simple way to script databases and jobs on Microsoft SQL 7 ? I would like to generate automatic scripts as part of our back-up process. SQL Books-Online state that it is possible using SQL-DMO, but before I go and reinvent the wheel for this, is there another easier way I may be overlooking ?

Thanks in advance.
 
Hi There

To Build a SQLScript of your jobs

1. Browse to SQLServerAgent><Jobs> in Enterprise
Manager
2. Right-Click on Jobs
3. Click on All Tasks
4. Select Script All Jobs
5. A Dialog Box will open where you can specify where you
want to save the script file.

Don't forget to back up your MSDB database as that is where all your job details are stored.

Hope This Helps


Bernadette
 
I fear I may not have been 100% clear. I would like to script databases, jobs, logins etc. programmatically for a new solution I have to implement without using Enterprise Manager. Although this is all possible by writing a small COM program, I would like to know if there are any stored procedures/extended stored procedures available in Microsoft SQL 7 that will allow me to do this.
 
Have a look at the following link and check out this stored procedure. It might just be what your looking for.


sp_scriptsql7db.sql - Submitted by: Sharon Dooley posted on 4/11/99
This script generates a database creation script for a 7.0 database - including files, filegroups, default filegroup and database options.

Rick.
 

Unfortunately, Sharon Dooley's procedure only scripts the creation of the database - not the objects in the database.

I've been working on a procedure for generating a SQL script using SQL DMO. I'll post my code as soon as I have it working to my satisfaction. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top