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






Tibor Karaszi

2005-10-29, 1:23 pm

http://www.karaszi.com/SQLServer/ i...ript
.asp


--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"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
>
>
>
>
>
>

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
>
>
>
>
>
>



Dejan Sarka

2005-10-29, 1:23 pm

I was searching for this article of yours a minute ago, but somehow I
couldn't find it...

--
Dejan Sarka

"Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote in
message news:uhNyQuK3FHA.472@TK2MSFTNGP15.phx.gbl...[color=darkred]
> http://www.karaszi.com/SQLServer/ i...ript
.asp

>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www. solidqualitylearning
.com/

> Blog: http:// solidqualitylearning
.com/blogs/tibor/

>
>
> "Smith John" <Smith_Jr@hotmail.com> wrote in message
> news:OZXYRiK3FHA.548@TK2MSFTNGP10.phx.gbl...

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com