SQL2K SP3a Win2k Pro SP4
Probably one for people using perl for scripting.
I'm having a problem scheduling perl scripts to run with sql agent.
All permissions are OK, PERL5LIB is set and the script will run perfectly
from the command line
When running through sql agent the following:
cmd /c "perl s:\production\getdbspaceused.pl"
It seems it won't pick up the PERL5LIB environment variable. Any ideas,
(without explicitly putting the path to the modules directory) or am I going
to have to use windows scheduler'
I've got task scheduler to run this (but i want the success/failure
notification available from sql agent)
TIA.
KevinI use ActivePerl from www.activestate.com, and have never
had any problem scheduling a Perl script via SQLServer
Agent, though I use Windows Task Scheduler more often to
run Perl scripts. If you have ActivePerl installed on the
server, you can just run a Perl script as (plus whatever
command line switches you may have) using an Operating
System Command job step type.
perl yourScript.pl
perl.exe should already be on the system path.
Linchi
>--Original Message--
>SQL2K SP3a Win2k Pro SP4
>Probably one for people using perl for scripting.
>I'm having a problem scheduling perl scripts to run with
sql agent.
>All permissions are OK, PERL5LIB is set and the script
will run perfectly
>from the command line
>When running through sql agent the following:
> cmd /c "perl s:\production\getdbspaceused.pl"
>It seems it won't pick up the PERL5LIB environment
variable. Any ideas,
>(without explicitly putting the path to the modules
directory) or am I going
>to have to use windows scheduler'
>I've got task scheduler to run this (but i want the
success/failure
>notification available from sql agent)
>
>TIA.
>Kevin
>
>.
>|||Hello Kevin,
Could you please try to run cmd /c "perl s:\production\getdbspaceused.pl"
using xp_cmdshell in the Query Analyser ?
Does that work without any problem ? If yes, you might want to create a Job
to run the same cmd and that way you can use the
SQL Agent successs/failure notifications.
Honestly, I have no experience with running the PERL scripts, but just
wanted to see if above works. Please let me know.
Thanks for using MSDN Managed Newsgroups.
Vikrant Dalwale
Microsoft SQL Server Support Professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Get secure !! For info, please visit http://www.microsoft.com/security.
Please reply to Newsgroups only.
--
| From: <KJGNews@.hotmail.com>
| Subject: Scheduling perl scripts with sqlagent
| Date: Wed, 21 Jan 2004 09:21:02 -0000
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OTbE$9$3DHA.1428@.TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: 62.190.182.219
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:325288
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| SQL2K SP3a Win2k Pro SP4
|
| Probably one for people using perl for scripting.
|
| I'm having a problem scheduling perl scripts to run with sql agent.
|
| All permissions are OK, PERL5LIB is set and the script will run perfectly
| from the command line
|
| When running through sql agent the following:
| cmd /c "perl s:\production\getdbspaceused.pl"
|
| It seems it won't pick up the PERL5LIB environment variable. Any ideas,
| (without explicitly putting the path to the modules directory) or am I
going
| to have to use windows scheduler'
|
| I've got task scheduler to run this (but i want the success/failure
| notification available from sql agent)
|
|
| TIA.
| Kevin
|
|
||||Thanks everybody for the help.
I came in this morning and the job has run, successfully and I don't know
why, although
I'm happy about this. Can only assume it took a period of time before the
environment
variable was recognised by the OS?
Anyway, thanks once again.
"Vikrant V Dalwale [MSFT]" <vikrantd@.online.microsoft.com> wrote in message
news:AZhoRpJ4DHA.3648@.cpmsftngxa07.phx.gbl...
>
> Hello Kevin,
> Could you please try to run cmd /c "perl s:\production\getdbspaceused.pl"
> using xp_cmdshell in the Query Analyser ?
> Does that work without any problem ? If yes, you might want to create a
Job
> to run the same cmd and that way you can use the
> SQL Agent successs/failure notifications.
> Honestly, I have no experience with running the PERL scripts, but just
> wanted to see if above works. Please let me know.
> Thanks for using MSDN Managed Newsgroups.
> Vikrant Dalwale
> Microsoft SQL Server Support Professional
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Get secure !! For info, please visit http://www.microsoft.com/security.
> Please reply to Newsgroups only.
> --
> | From: <KJGNews@.hotmail.com>
> | Subject: Scheduling perl scripts with sqlagent
> | Date: Wed, 21 Jan 2004 09:21:02 -0000
> | Lines: 24
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> | Message-ID: <OTbE$9$3DHA.1428@.TK2MSFTNGP12.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.server
> | NNTP-Posting-Host: 62.190.182.219
> | Path:
>
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
> phx.gbl!TK2MSFTNGP12.phx.gbl
> | Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:325288
> | X-Tomcat-NG: microsoft.public.sqlserver.server
> |
> | SQL2K SP3a Win2k Pro SP4
> |
> | Probably one for people using perl for scripting.
> |
> | I'm having a problem scheduling perl scripts to run with sql agent.
> |
> | All permissions are OK, PERL5LIB is set and the script will run
perfectly
> | from the command line
> |
> | When running through sql agent the following:
> | cmd /c "perl s:\production\getdbspaceused.pl"
> |
> | It seems it won't pick up the PERL5LIB environment variable. Any ideas,
> | (without explicitly putting the path to the modules directory) or am I
> going
> | to have to use windows scheduler'
> |
> | I've got task scheduler to run this (but i want the success/failure
> | notification available from sql agent)
> |
> |
> | TIA.
> | Kevin
> |
> |
> |
>
Showing posts with label scripting. Show all posts
Showing posts with label scripting. Show all posts
Wednesday, March 28, 2012
Scheduling perl scripts with sqlagent
SQL2K SP3a Win2k Pro SP4
Probably one for people using PERL for scripting.
I'm having a problem scheduling PERL scripts to run with sql agent.
All permissions are OK, PERL5LIB is set and the script will run perfectly
from the command line
When running through sql agent the following:
cmd /c "perl s:\production\getdbspaceused.pl"
It seems it won't pick up the PERL5LIB environment variable. Any ideas,
(without explicitly putting the path to the modules directory) or am I going
to have to use windows scheduler'
I've got task scheduler to run this (but i want the success/failure
notification available from sql agent)
TIA.
KevinI use ActivePerl from www.activestate.com, and have never
had any problem scheduling a PERL script via SQLServer
Agent, though I use Windows Task Scheduler more often to
run PERL scripts. If you have ActivePerl installed on the
server, you can just run a PERL script as (plus whatever
command line switches you may have) using an Operating
System Command job step type.
perl yourScript.pl
perl.exe should already be on the system path.
Linchi
sql agent.
will run perfectly
variable. Any ideas,
directory) or am I going
success/failure
Could you please try to run cmd /c "perl s:\production\getdbspaceused.pl"
using xp_cmdshell in the Query Analyser ?
Does that work without any problem ? If yes, you might want to create a Job
to run the same cmd and that way you can use the
SQL Agent successs/failure notifications.
Honestly, I have no experience with running the PERL scripts, but just
wanted to see if above works. Please let me know.
Thanks for using MSDN Managed Newsgroups.
Vikrant Dalwale
Microsoft SQL Server Support Professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Get secure !! For info, please visit http://www.microsoft.com/security.
Please reply to Newsgroups only.
| From: <KJGNews@.hotmail.com>
| Subject: Scheduling PERL scripts with sqlagent
| Date: Wed, 21 Jan 2004 09:21:02 -0000
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OTbE$9$3DHA.1428@.TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: 62.190.182.219
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:325288
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| SQL2K SP3a Win2k Pro SP4
|
| Probably one for people using PERL for scripting.
|
| I'm having a problem scheduling PERL scripts to run with sql agent.
|
| All permissions are OK, PERL5LIB is set and the script will run perfectly
| from the command line
|
| When running through sql agent the following:
| cmd /c "perl s:\production\getdbspaceused.pl"
|
| It seems it won't pick up the PERL5LIB environment variable. Any ideas,
| (without explicitly putting the path to the modules directory) or am I
going
| to have to use windows scheduler'
|
| I've got task scheduler to run this (but i want the success/failure
| notification available from sql agent)
|
|
| TIA.
| Kevin
|
|
||||Thanks everybody for the help.
I came in this morning and the job has run, successfully and I don't know
why, although
I'm happy about this. Can only assume it took a period of time before the
environment
variable was recognised by the OS?
Anyway, thanks once again.
"Vikrant V Dalwale [MSFT]" <vikrantd@.online.microsoft.com> wrote in message
news:AZhoRpJ4DHA.3648@.cpmsftngxa07.phx.gbl...
Job
rights.
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
perfectly
Probably one for people using PERL for scripting.
I'm having a problem scheduling PERL scripts to run with sql agent.
All permissions are OK, PERL5LIB is set and the script will run perfectly
from the command line
When running through sql agent the following:
cmd /c "perl s:\production\getdbspaceused.pl"
It seems it won't pick up the PERL5LIB environment variable. Any ideas,
(without explicitly putting the path to the modules directory) or am I going
to have to use windows scheduler'
I've got task scheduler to run this (but i want the success/failure
notification available from sql agent)
TIA.
KevinI use ActivePerl from www.activestate.com, and have never
had any problem scheduling a PERL script via SQLServer
Agent, though I use Windows Task Scheduler more often to
run PERL scripts. If you have ActivePerl installed on the
server, you can just run a PERL script as (plus whatever
command line switches you may have) using an Operating
System Command job step type.
perl yourScript.pl
perl.exe should already be on the system path.
Linchi
quote:
>--Original Message--
>SQL2K SP3a Win2k Pro SP4
>Probably one for people using PERL for scripting.
>I'm having a problem scheduling PERL scripts to run with
sql agent.
quote:
>All permissions are OK, PERL5LIB is set and the script
will run perfectly
quote:
>from the command line
>When running through sql agent the following:
> cmd /c "perl s:\production\getdbspaceused.pl"
>It seems it won't pick up the PERL5LIB environment
variable. Any ideas,
quote:
>(without explicitly putting the path to the modules
directory) or am I going
quote:
>to have to use windows scheduler'
>I've got task scheduler to run this (but i want the
success/failure
quote:|||Hello Kevin,
>notification available from sql agent)
>
>TIA.
>Kevin
>
>.
>
Could you please try to run cmd /c "perl s:\production\getdbspaceused.pl"
using xp_cmdshell in the Query Analyser ?
Does that work without any problem ? If yes, you might want to create a Job
to run the same cmd and that way you can use the
SQL Agent successs/failure notifications.
Honestly, I have no experience with running the PERL scripts, but just
wanted to see if above works. Please let me know.
Thanks for using MSDN Managed Newsgroups.
Vikrant Dalwale
Microsoft SQL Server Support Professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Get secure !! For info, please visit http://www.microsoft.com/security.
Please reply to Newsgroups only.
| From: <KJGNews@.hotmail.com>
| Subject: Scheduling PERL scripts with sqlagent
| Date: Wed, 21 Jan 2004 09:21:02 -0000
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OTbE$9$3DHA.1428@.TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: 62.190.182.219
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:325288
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| SQL2K SP3a Win2k Pro SP4
|
| Probably one for people using PERL for scripting.
|
| I'm having a problem scheduling PERL scripts to run with sql agent.
|
| All permissions are OK, PERL5LIB is set and the script will run perfectly
| from the command line
|
| When running through sql agent the following:
| cmd /c "perl s:\production\getdbspaceused.pl"
|
| It seems it won't pick up the PERL5LIB environment variable. Any ideas,
| (without explicitly putting the path to the modules directory) or am I
going
| to have to use windows scheduler'
|
| I've got task scheduler to run this (but i want the success/failure
| notification available from sql agent)
|
|
| TIA.
| Kevin
|
|
||||Thanks everybody for the help.
I came in this morning and the job has run, successfully and I don't know
why, although
I'm happy about this. Can only assume it took a period of time before the
environment
variable was recognised by the OS?
Anyway, thanks once again.
"Vikrant V Dalwale [MSFT]" <vikrantd@.online.microsoft.com> wrote in message
news:AZhoRpJ4DHA.3648@.cpmsftngxa07.phx.gbl...
quote:
>
> Hello Kevin,
> Could you please try to run cmd /c "perl s:\production\getdbspaceused.pl"
> using xp_cmdshell in the Query Analyser ?
> Does that work without any problem ? If yes, you might want to create a
Job
quote:
> to run the same cmd and that way you can use the
> SQL Agent successs/failure notifications.
> Honestly, I have no experience with running the PERL scripts, but just
> wanted to see if above works. Please let me know.
> Thanks for using MSDN Managed Newsgroups.
> Vikrant Dalwale
> Microsoft SQL Server Support Professional
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
quote:
> Get secure !! For info, please visit http://www.microsoft.com/security.
> Please reply to Newsgroups only.
> --
> | From: <KJGNews@.hotmail.com>
> | Subject: Scheduling PERL scripts with sqlagent
> | Date: Wed, 21 Jan 2004 09:21:02 -0000
> | Lines: 24
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> | Message-ID: <OTbE$9$3DHA.1428@.TK2MSFTNGP12.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.server
> | NNTP-Posting-Host: 62.190.182.219
> | Path:
>
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
quote:
> phx.gbl!TK2MSFTNGP12.phx.gbl
> | Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:325288
> | X-Tomcat-NG: microsoft.public.sqlserver.server
> |
> | SQL2K SP3a Win2k Pro SP4
> |
> | Probably one for people using PERL for scripting.
> |
> | I'm having a problem scheduling PERL scripts to run with sql agent.
> |
> | All permissions are OK, PERL5LIB is set and the script will run
perfectly
quote:
> | from the command line
> |
> | When running through sql agent the following:
> | cmd /c "perl s:\production\getdbspaceused.pl"
> |
> | It seems it won't pick up the PERL5LIB environment variable. Any ideas,
> | (without explicitly putting the path to the modules directory) or am I
> going
> | to have to use windows scheduler'
> |
> | I've got task scheduler to run this (but i want the success/failure
> | notification available from sql agent)
> |
> |
> | TIA.
> | Kevin
> |
> |
> |
>
Monday, March 26, 2012
Scheduling DB Scripting
Is there any way I can schedule DB scripting? Let's say I want to script
every production DB on a daily bases.
Thank you in advance for your help
Leon ShargorodskyCreate a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/databas...evaluation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
[vbcol=seagreen]
> or you could use a free scripting tool which has a com interface and creat
e
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/databas...evaluation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
>
every production DB on a daily bases.
Thank you in advance for your help
Leon ShargorodskyCreate a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/databas...evaluation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
[vbcol=seagreen]
> or you could use a free scripting tool which has a com interface and creat
e
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/databas...evaluation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
>
Labels:
advance,
bases,
database,
microsoft,
mysql,
oracle,
production,
schedule,
scheduling,
scriptevery,
scripting,
server,
sql
Scheduling DB Scripting
Is there any way I can schedule DB scripting? Let's say I want to script
every production DB on a daily bases.
Thank you in advance for your help
Leon ShargorodskyCreate a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/database_change_management_evaluation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
> or you could use a free scripting tool which has a com interface and create
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/database_change_management_evaluation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
> > Is there any way I can schedule DB scripting? Let's say I want to script
> > every production DB on a daily bases.
> >
> > Thank you in advance for your help
> >
> > Leon Shargorodsky
every production DB on a daily bases.
Thank you in advance for your help
Leon ShargorodskyCreate a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/database_change_management_evaluation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
> or you could use a free scripting tool which has a com interface and create
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/database_change_management_evaluation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
> > Is there any way I can schedule DB scripting? Let's say I want to script
> > every production DB on a daily bases.
> >
> > Thank you in advance for your help
> >
> > Leon Shargorodsky
Scheduling DB Scripting
Is there any way I can schedule DB scripting? Let's say I want to script
every production DB on a daily bases.
Thank you in advance for your help
Leon Shargorodsky
Create a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky
|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/database...valuation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky
|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
[vbcol=seagreen]
> or you could use a free scripting tool which has a com interface and create
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/database...valuation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
sql
every production DB on a daily bases.
Thank you in advance for your help
Leon Shargorodsky
Create a job with an ActiveX type and use DMO to script the db's. Here is a
sample:
-- **** SCRIPT ALL USER DB's **** --
Sub Main()
Dim oSS
Set oSS = CreateObject("SQLDMO.SQLServer2")
Dim oDb
Set oDb = CreateObject("SQLDMO.Database2")
Dim lcPwd
Dim lcServer
Dim lcFile
Dim lcDB
lcServer = "BULLDOG2"
oSS.LoginSecure = True
oSS.Connect lcServer
Dim lcDBList
Dim dbArray
lcDBList = "Presents|Northwind|Model"
dbArray = Split(lcDBList, "|")
For Each lcDB In dbArray
Set oDb = oSS.Databases(lcDB)
Dim oT
Set oT = CreateObject("SQLDMO.Transfer2")
lcFile = "C:\Data\DB_Scripts\" & lcDB & "_" & Year(Now) & Right("0"
& Month(Now), 2) & Right("0" & Day(Now), 2) & ".sql"
oT.CopyAllObjects = True
oT.IncludeUsers = True
oT.IncludeLogins = True
oT.IncludeDB = True
oDb.ScriptTransfer oT, 2, lcFile
Set oT = Nothing
Next
Set oDb = Nothing
Set oSS = Nothing
End Sub
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:C0204E43-0613-4D6B-AE28-53F6DCA3B405@.microsoft.com...
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky
|||or you could use a free scripting tool which has a com interface and create
vb script to run it, then create a sql job with an active x step in it and
schedule it to a time you want -
http://www.innovartis.co.uk/database...valuation.aspx
It comes free with an evaluation copy of DB Ghost
"Leon Shargorodsky" wrote:
> Is there any way I can schedule DB scripting? Let's say I want to script
> every production DB on a daily bases.
> Thank you in advance for your help
> Leon Shargorodsky
|||Andrew, Mark, thanks a lot for your help!
"mark baekdal" wrote:
[vbcol=seagreen]
> or you could use a free scripting tool which has a com interface and create
> vb script to run it, then create a sql job with an active x step in it and
> schedule it to a time you want -
> http://www.innovartis.co.uk/database...valuation.aspx
> It comes free with an evaluation copy of DB Ghost
> "Leon Shargorodsky" wrote:
sql
Labels:
advance,
bases,
database,
microsoft,
mysql,
oracle,
production,
schedule,
scheduling,
scriptevery,
scripting,
server,
sql
Subscribe to:
Posts (Atom)