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
 Development Tools
 ASP.NET
 Using SQL DMO in Visual Basic

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-06-11 : 09:57:26
Lynda writes "I am using SQL DMO in Visual Basic to script out the stored procedures in my SQL 2000 database. I am running into a problem because some of my stored procedures are very long. The Script() command cuts off the stored procedures that are long.

'Script the selected stored proc
Set oStoredProc = Database.StoredProcedures “spTestLongStoredProcedure”)

RichTextScript.Text = RichTextScript.Text & oStoredProc.Script(131109)

I don't think that the rich text box is the problem, because it will hold multiple scripts that are smaller, but that combined are larger than the stored procedure that gets cut off. Is there a limit on how much text can be returned from the Script() command. Is there a better way approach?"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-06-11 : 10:36:25
You can generate the script from sql. Generate the files on the server then copy them if necessary.
There are SPs to do it at

http://www.nigelrivett.net/DMOScripting.html
http://www.nigelrivett.net/DMOScriptAllDatabases.html


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -