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
 SQL Server Development (2000)
 SQL DMO Scripting problem

Author  Topic 

johnsoar
Yak Posting Veteran

66 Posts

Posted - 2001-09-13 : 15:11:29
Background:
Created a vb app using ADO and SQLDMO to dynamically create delete and insert scripts to get data to clients that we had no connection to and to maintain a record in VSS. APP scan's all sql servers on network, allows user to select one, they choose db, which puts tables in list box respective to their relational nature, user picks tables, msgbox pops-up asking if user whishes to keep integrity...if so required tables are moved also...if not a flag is set to disable and re-enable constraints in the proper location, choose a file location and generates script. Send the script to the client who executes script in QA-Walla

Anyways, I give them the opportunity to create table scripts before the delete/insert if the tables are not at the client yet.
Code:

Set oIdent = oSQLDatabase.Tables(strTableNameLst3)
strTableScriptLst3 = oIdent.Script(SQLDMOScript_NoDRI)
Print #1, strTableScriptLst3

And the same code with SQLDMOScipt_DRI_All in place of SQLDMOScript_NoDRI after the delete/insert
I only get the DRI; no create table statements without the DRI in the beginning of the file.

If I just go ahead with the default (SQLDMOScript_Default) in the beginning it works, but I don't want the DRI to be created until the end. I know I could just issue statements to disable and then enable, but the option is there and I want to use it.

Any ideas will be greatly appreciated


Adam

Edited by - johnsoar on 09/13/2001 15:12:25
   

- Advertisement -