Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 GENERATE SCRIPT in SQLDMO

Author  Topic 

amirkatz
Starting Member

5 Posts

Posted - 2005-04-12 : 12:25:42
Hi all,
I'v built an application that takes some stored procedures and places them in a folder.
The problem is that the type of script generated isnt the right one 4 me, im looking for exactly the same kind of scripts generated by DTS Import/export Wizard. meaning - first check if exists then if true drop and create a new STP.
im now running this line of code:

Dim objProc As SQLDMO.StoredProcedure
objProc.Script SQLDMOScript_Default + SQLDMOScript_Drops + SQLDMOScript_DatabasePermissions, FileName

and secondly could i gather all the procedures taken out and build a single file (and not a file 4 each STP).
TIA
Amir

Kristen
Test

22859 Posts

Posted - 2005-04-12 : 12:30:05
http://www.mindsdoor.net/DMO/DMOScriptAllDatabases.html

Kristen
Go to Top of Page

amirkatz
Starting Member

5 Posts

Posted - 2005-04-12 : 13:38:06
Could you please elaborate....
isnt there just an equivalent property to those i posted above that will generate the desired script?
Go to Top of Page

amirkatz
Starting Member

5 Posts

Posted - 2005-04-12 : 13:44:20
The solution u proposed isnt right for me ...
The destinaton computer isnt connected to source safe - its secured and isolated
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-04-12 : 20:55:56
There are a few articles here that contain the answers.

http://www.sqlteam.com/searchresults.asp?SearchTerms=dmo



Damian
Ita erat quando hic adveni.
Go to Top of Page

MakeYourDaddyProud

184 Posts

Posted - 2005-04-13 : 09:48:24
One piece of advice I must suggest is that make sure your error handling is watertight. VB was never know for it's error handling so you must ensure that the database script file created matches that what would be produced by the manual "Generate Scipts" option, though I am not sure as to how this could be implemented.

One or two of the names here look familiar...

Hmmm

Whammy Bar String Trasher
Go to Top of Page
   

- Advertisement -