|
Home > Archive > MS SQL Server > October 2005 > Scripting automation....
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Scripting automation....
|
|
| Smith John 2005-10-29, 1:23 pm |
| Is there any stored procedure for scripting the database?
SQL 2K.
Thanks,
John
| |
|
|
| Dejan Sarka 2005-10-29, 1:23 pm |
| There is no sp; you can use DMO (Distributed Management Objects) in some
scripting language. You can execite ActiveX script task in a scheduled job.
Here is an example of using DMO in vbscript :
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.LoginSecure = True
oSS.Connect
Set oDb = oSS.Databases("pubs")
oT.CopyAllTables = True
oDb.ScriptTransfer oT, SQLDMOXfrFile_Single
File, "C:\pubs.sql"
End Sub
--
Dejan Sarka, SQL Server MVP
Mentor
www. SolidQualityLearning
.com
"Smith John" <Smith_Jr@hotmail.com> wrote in message
news:OZXYRiK3FHA.548@TK2MSFTNGP10.phx.gbl...
> Is there any stored procedure for scripting the database?
> SQL 2K.
> Thanks,
> John
>
>
>
>
>
>
| |
|
|
|
|
|