Generating SQL DB Scripts 
Author Message
 Generating SQL DB Scripts
Is there an easy way to generate SQL scripts automatically (through a
task, maintenance plan or DTS) so that everything is output to one file?
I have set up packages in DTS but all objects are scripted to individual
object files (ex. Procs to the .PRC file, views to the .VIW file). Any
suggestion?


Mon, 25 Aug 2003 06:19:55 GMT
 Generating SQL DB Scripts

Check ..\MSSQL7\Upgrade\scptxfr.exe /F

Bart Simpson



Quote:
>Is there an easy way to generate SQL scripts automatically (through a
>task, maintenance plan or DTS) so that everything is output to one file?
>I have set up packages in DTS but all objects are scripted to individual
>object files (ex. Procs to the .PRC file, views to the .VIW file). Any
>suggestion?



Mon, 25 Aug 2003 07:54:01 GMT
 Generating SQL DB Scripts
Carla,

Dim oSS As SQLDMO.SQLServer
Dim oDb As SQLDMO.Database
Dim oT As SQLDMO.Transfer
Dim sS As String
Sub Script()
    Set oSS = New SQLDMO.SQLServer
    Set oT = New SQLDMO.Transfer
    oSS.Connect "server", "user", "password"  'Connect to the server
    Set oDb = oSS.Databases("pubs")           'Use a DB
    oT.CopyAllTables = True
    oDb.ScriptTransfer oT, SQLDMOXfrFile_SingleFile, "C:\pubs.sql"
End Sub

--
Tibor Karaszi, SQL Server MVP
FAQ from Neil at: http://www.sqlserverfaq.com
Please reply to the newsgroup only, not by email.


Quote:
> Is there an easy way to generate SQL scripts automatically (through a
> task, maintenance plan or DTS) so that everything is output to one file?
> I have set up packages in DTS but all objects are scripted to individual
> object files (ex. Procs to the .PRC file, views to the .VIW file). Any
> suggestion?



Tue, 26 Aug 2003 22:16:17 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Generate MS-ACCESS table using SQL Script generated by SQL Server

2. SQL Script to generate SQL Scripts???

3. generate SQL scripts from a script or stored procedure

4. Generating a Compare/Synch-DB script

5. Generating script for object of a DB schema...

6. generating all objects from db via script

7. Generate SQL script in SQL 2000 for SQL 6.5

8. auto-generate db change script ?

9. How to generate script of a db

10. How to generate script of db using sp

11. generate db script

12. Benchmarking to Generate File Scripts for DB


 
Powered by phpBB® Forum Software