July 6, 2018 at 11:17 am
Hi
I have a vbs script that runs fine in the command line(It uses CuteFTP to upload a file )
I tried to run in a scheduled SQL job it gets no errors but produces no output
I tried to put "cscript c:\scripts\beacon.vbs" in a .bat file and run the .bat in CMDexec
Figuring I could use Active X script ????
any ideas would be great
Thaks
Joe
July 6, 2018 at 11:49 am
jbalbo - Friday, July 6, 2018 11:17 AMHiI have a vbs script that runs fine in the command line(It uses CuteFTP to upload a file )
I tried to run in a scheduled SQL job it gets no errors but produces no outputI tried to put "cscript c:\scripts\beacon.vbs" in a .bat file and run the .bat in CMDexec
Figuring I could use Active X script ????
any ideas would be great
Thaks
Joe
Why don't you just set a task in Task Scheduler at the operating system to run it whenever you need it?
I think using the SQL Server Agent to run stuff that don't belong to the SQL instance is bad practice.
Greetings
July 6, 2018 at 12:31 pm
Thanks
My idea was step one moves a file, then 2 runs the ftp script , then if it fails, for some reason, I could get a notice
July 6, 2018 at 1:20 pm
Alejandro Santana - Friday, July 6, 2018 11:49 AMI think using the SQL Server Agent to run stuff that don't belong to the SQL instance is bad practice.
I have diametrically the opposite opinion. What makes you say that it's a bad practice?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2018 at 1:24 pm
jbalbo - Friday, July 6, 2018 12:31 PMThanks
My idea was step one moves a file, then 2 runs the ftp script , then if it fails, for some reason, I could get a notice
Does your SQL Server agent actually have access to the directory where the script is?
July 6, 2018 at 1:31 pm
Yes I just checked agin
July 9, 2018 at 5:15 am
Jeff Moden - Friday, July 6, 2018 1:20 PMAlejandro Santana - Friday, July 6, 2018 11:49 AMI think using the SQL Server Agent to run stuff that don't belong to the SQL instance is bad practice.I have diametrically the opposite opinion. What makes you say that it's a bad practice?
+1 🙂
Far away is close at hand in the images of elsewhere.
Anon.
July 9, 2018 at 6:01 am
Jeff Moden - Friday, July 6, 2018 1:20 PMAlejandro Santana - Friday, July 6, 2018 11:49 AMI think using the SQL Server Agent to run stuff that don't belong to the SQL instance is bad practice.I have diametrically the opposite opinion. What makes you say that it's a bad practice?
I believed that running stuff that didn't belong to the instance of SQL server in the long run would be tedious, but after reading his answer i told to myself that one indeed pays more attention to the SQL server agent than the server task scheduler, and it's as he says.
My idea was step one moves a file, then 2 runs the ftp script , then if it fails, for some reason, I could get a notice
Its more effective about handling if it fails or if it succeeds.
And if migrating the SQL Instance you would be thinking more of the jobs than the task scheduler tasks.
July 9, 2018 at 6:12 am
jbalbo - Friday, July 6, 2018 1:31 PMYes I just checked agin
My idea was step one moves a file, then 2 runs the ftp script , then if it fails, for some reason, I could get a notice
You have a script that makes the whole task? If so, try to make a .bat and with that .bat call the main task.
example: starttask.bat > maintask.bat.
if that doesn't work you could try using xp_cmdshell from SQL Server and putting it in a job like you said earlier.
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql?view=sql-server-2017
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply