Adding a VB 'Job' in SQL Enterprise Manager

Hi

I added a Job in Enterprise manager and this is the script

set FSO = server.createobject("Scripting.FileSystemObject")
set filewriter = FSO.createtextfile("d:/yourdirectory/yourfile.html")
filewriter.writeline "hello world"

set fso = nothing
set filewriter = nothing

And I set it to run every minute.

However
1 - nothing was created on my harddisk
2 - i cant seem to go back to edit or view the job?

thanks
paulwhelanAsked:
Who is Participating?
 
[ fanpages ]IT Services ConsultantCommented:
type the Operating system shell command you want this job to execute"

That's not where I meant, but this will work also.

Type in that field the full path/filename of the ".vbs" file you saved (from the above code).

"Execute Process Task" is an option within the Data Transformation Services tasks.

Sorry for not going into more detail... but I'm just in a rush to leave for an appointment.

Let me know how you get on, or whether angelIII's suggestion proves more useful.

BFN,

fp.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
set FSO = server.createobject("Scripting.FileSystemObject")
set filewriter = FSO.createtextfile("d:/yourdirectory/yourfile.html")
filewriter.writeline "hello world"
filewriter.close
set fso = nothing
set filewriter = nothing

where is the drive D: (ie is it a local harddisk)
is the sql server local on your computer or on a remote server?

2) well, possibly you didn't create the job correctly, hence was not saved, hence did not run.

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
set filewriter = FSO.createtextfile("d:/yourdirectory/yourfile.html")

should also be:
set filewriter = FSO.createtextfile("d:\yourdirectory\yourfile.html")
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
[ fanpages ]IT Services ConsultantCommented:
See my comment in the related question:

"check if a website is 'live'"
[ http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21871271.html ]

===
Take your VBScript you pasted above & place it in a distinct file external to Enterprise Manager (and give it a ".vbs" extension).

Now set Enterprise Manager to run this .vbs file instead ("Execute Process Task" -> Set "Win32 Process" to be the full folder path/filename where you have saved the .vbs file).

Once you have this working we can look at re-coding the above suggestions in VBScript, rather than in VB(A) as they are shown in the previous comments.
===

BFN,

fp.
0
 
paulwhelanAuthor Commented:
Hi fanpages

Where is "Execute Process Task"?
Should I do
Tools
Job Scheduling?

If I do that it gives me three options

TSQL command
Operating system shell command (eg run a batch script or invoke an application)
Active script (vbscript or javascript)

If I select Operation system shell command
it says
"type the Operating system shell command you want this job to execute"

What do I type here?

Thanks
Paul

0
 
paulwhelanAuthor Commented:
angel

Thanks
Im trying
set filewriter = FSO.createtextfile("d:\yourdirectory\yourfile.html")
now
So i will let you know

Also is there a way to view / edit old jobs?
I cant seem to find the ones i created
0
 
paulwhelanAuthor Commented:
angel
That didn't seem to work either
Would there be a simple insert i could do into my database instead of the 'write to d:'
thanks
paul
0
 
EDDYKTCommented:
set FSO = server.createobject("Scripting.FileSystemObject")

should it be


set FSO = wscript.createobject("Scripting.FileSystemObject")
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.