Re: Creating a DTS ActiveX Task
From: alien2_51 (dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion)
Date: 09/16/04
- Next message: Hugo Kornelis: "Re: One to many relationship"
- Previous message: Kalen Delaney: "Re: convert a date to a string?"
- In reply to: mgm: "Creating a DTS ActiveX Task"
- Next in thread: mgm: "Re: Creating a DTS ActiveX Task"
- Reply: mgm: "Re: Creating a DTS ActiveX Task"
- Reply: mgm: "Re: Creating a DTS ActiveX Task"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 14:43:43 -0700
The Main function in the active x script is the entry point, you must write
code to do something from here, otherwise nothihng will happen also if you
do not return DTSTaskExecResult_Success from this function the step will
show as failing, this is why this is the only line in the default script.
Schedule the DTS package by right clicking and selecting Schedule Packsge,
once this is done you can modify the schedule or disable the job from the
Management>SQL Agent>Jobs in EM. Keep in mind this package will run in the
context of the SQL Agent service account when run from a job.
"mgm" <mgm@discussions.microsoft.com> wrote in message
news:E3D5A713-3A09-44B8-8B55-A80BF7157D9A@microsoft.com...
> I've never used DTS and was wondering how to schedule a script to run. I
> notice when you open an ActiveX Script Task it's formated like this:
> Function Main()
> Main = DTSTaskExecResult_Success
> End Function
>
> I wrote a script that will query a database and send a mail to certain
> recipients with the results in the mail (using CDO). The query works when
I
> run it, but I don't know how to schedule it. I pasted my code into the
> ActiveX Script Task with and without the "Function Main()..." and it won't
> work.
>
> After I schedule it to run I look in SQL Server Agent - Jobs and it says:
> The job failed. The Job was invoked by Schedule 12 (Name of DTS Package).
> The last step to run was step 1 (Name of DTS Package).
>
> Can anyone help me get my script to run automatically on a daily basis -
> whether using DTS or not?
>
> Thanks!
- Next message: Hugo Kornelis: "Re: One to many relationship"
- Previous message: Kalen Delaney: "Re: convert a date to a string?"
- In reply to: mgm: "Creating a DTS ActiveX Task"
- Next in thread: mgm: "Re: Creating a DTS ActiveX Task"
- Reply: mgm: "Re: Creating a DTS ActiveX Task"
- Reply: mgm: "Re: Creating a DTS ActiveX Task"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|