Scheduled DTS Job To Run A Cmd File Not Working
Feb 2, 2006
Hi,
I have created a DTS job that contains one 'Execute SQL Task' job. This SQL task runs a cmd file. The cmd file runs a few windows commands and then runs a Micorosoft Access Macro. Once finished both access and the cmd screen close down.
If I open up the DTS job and execute it manually, it works fine (takes about 1/2 an hour to run). My problem is that when I schedule the DTS job, the job starts up at the correct time but it never actually starts running the cmd file and it gives no error. It says Executing until I actually stop the job manually.
The Job details are:
Type: Operating System Command [CmdExec]
Command: DTSRun /~Z0x2F3FF84472BB6E7FF356EB006BA1AEC62C95AB3BF506F3 4A241F228CE148AB09DBC66B8651A450B725E6C4E6A1D328E4 EC2F2C0F8E323F1C7D501FD5B8FD00E25656514AF2224407DB 1C569163CBE383A8E7D8BE4974A0911F5CEB
The DTS details are:
C:BatchesDTSrunofUpdatesqlpmi.cmd
The cmd program details are:
echo on
:Start
if not exist "c:appsCI_Databasespmipmiload.mdb" exit
rem cleanup unfinsihed runs
if exist "c:appsCI_Databasespmipmiload.mdb" if exist "c:appsCI_Databasespmipmiloadold.mdb" del "c:appsCI_Databasespmipmiloadold.mdb"
rem main file locked assume its being work on so don't run this job.
if exist "c:appsCI_Databasespmipmiload.ldb" exit
rem if a tmp exits then the last job never completed - continue to add to tmp file
if exist "c:appsCI_Databasespmipmiloadtmp.mdb" goto Load
copy "c:appsCI_Databasespmipmiload.mdb" "c:appsCI_Databasespmipmiloadtmp.mdb"
:Load
"C:Program Filesmicrosoft office 2003OFFICE11msaccess.exe" "c:appsCI_Databasespmipmiloadtmp.mdb"/x updatedata
rem Compact databases
"C:Program Filesmicrosoft office 2003OFFICE11msaccess.exe" "c:appsCI_Databasespmipmiloadtmp.mdb"/compact
ren "c:appsCI_Databasespmipmiload.mdb" "pmiloadold.mdb"
ren "c:appsCI_Databasespmipmiloadtmp.mdb" "pmiload.mdb"
if exist "c:appsCI_Databasespmipmiload.mdb" if exist "c:appsCI_Databasespmipmiloadold.mdb" del "c:appsCI_Databasespmipmiloadold.mdb"
All help is greatly appreciated as this has been bugging me for some time now.
Thanks
Sam
View 2 Replies
ADVERTISEMENT
May 19, 2006
I have created a scheduled job in the enterprise manager, which checks around 20 different date columns and replaces any non-dates with NULL using the following syntax: -
update policy set [exp] =null where isdate (substring([exp],4,2)+'-'+left([exp],2)+'-'+'200'+right ([exp],1 ))=0
go
update policy set [eff] =null where isdate (substring([eff],4,2)+'-'+left([eff],2)+'-'+'200'+right ([eff],1 ))=0
go
update policy set [written] =null where isdate (substring([written],4,2)+'-'+left([written],2)+'-'+'200'+right ([written],1 ))=0
go
etc......
When I start the job, if fails within 2 seconds. If I copy the syntax in to the query analyzer it works fine.
All help appreciated.
View 7 Replies
View Related
May 22, 2002
I want delete a file from the NTFS file system (assuming the right permissions are given) using the script or any other way. But I need to schedule a job which reads some table in SQL server and determines which files needs to be deleted and then I need to phyiscally delete these files.
Please can anybody help me putting me in the right direction
Thanks in advance.
View 1 Replies
View Related
Oct 5, 2006
I have an SSIS package that I created that looks like the following:
Execute SQL Task [Determines the file name]
Data Flow Task
Source - Query [Grabs the data]
Destination [Saves data to file on network drive]
Send Mail Task [Tells user to get file from network]
When I run this package inside Microsoft
Visual Studio I get the results I want. It sends the file to the
network drive and because there are SSN's in the file, it doesn't
actually e-mail the file but puts it in a secure location for the
person to get the file.
When I schedule this in SQL Server 2005 I get the file saved to: c:windowssystem32dynamicfilename.csv
So somehow it is still able to determine what the file name should be, but instead of sending the file to the right destination when you run it through VS, it flops out and sends it to this wacky directory.
I've
spent too much time on this and was wondering if someone can point me
in the right direction without going to the extent of writing a script
like this suggests. thread1555-1265108
Thanks,
Keith
View 6 Replies
View Related
Aug 21, 2001
Recently converted from 7 to sql 2k.
Running NT 4.0, sp6a. and sql 2k. I have a DTS job that works just fine if i go to 'design view' and then 'execute' it. But if I schedule it, the following error appears.. My question is... why? Also I modified the path from the current below (denapp02cmc$cd01.txt to the local path of the server as well... still came up with the same problem. ?? TIA! ::
DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: Copy Data from Results to denapp02cmc$cd01.txt Step DTSRun OnError: Copy Data from Results to denapp02cmc$cd01.txt Step, Error = -2147467259 (80004005) Error string: Error opening datafile: Access is denied. Error source: Microsoft Data Transformation Services Flat File Rowset Provider Help file: DTSFFile.hlp Help context: 0 Error Detail Records: Error: 5 (5); Provider Error: 5 (5) Error string: Error opening datafile: Access is denied.
View 2 Replies
View Related
Jun 17, 2015
I'm using SSMS 2012. I have multiple queries that are run daily(I also have a few that are run every Monday) that I want to schedule to run at midnight and export to a new xls file on the network drive to be used the next morning. Is there something that I can add to each query to accomplish this or would I have to set something else up to call the queries?
View 3 Replies
View Related
Apr 17, 2011
I have an existing MS SQL database (2008 R2). I have a very simple SQL script. I need to run this script on a daily basis and save the results as a .csv file.
I've tried creating a job in SQL Manager - that didn't work. Then I found a tutorial that had me use MS Visual Studio... couldn't get that to function either.
what program I should be using, and how to go about creating this as a task / job that can run on a scheduled basis?
View 13 Replies
View Related
May 8, 2006
We are not certain if this has happened due to the SSIS FTP Task, but incidently the Excel file that is being copied from the FTP site using an SSIS FTP Task got corrupted a couple hours after the package was scheduled as a SQL Server Agent Job on SQL Server 2005.
I had a SQL Server 2000 DTS package doing the same thing, but it was never an issue then. I was using the FTP Task there along with an Excel Data source in that and has been working for a couple years atleast with never any corruption related issues.
In the SSIS SQL Server 2005 package I am using an FTP Task with an Excel Connection Manager and Excel source and the Excel file got corrupted within a couple hours of the package being scheduled as a SQL Server Agent job.
Has anyone experienced this issue? Any inputs will be appreciated.
Just as an fyi, the excel file has a lot of vlookups.
Thanks,
MShah
View 1 Replies
View Related
Jul 28, 2006
I am working with an ftp task which is using a file connection to send a file to a remote server. This file is going to have a dynamic name (e.g. "Orders for 2006-07-29.txt"). How can I dynamically specify the file path/name for the file connection? You can't specify a varaible through the ui.
I would imagine that you can do this through a script task but I'm not sure how to reference the connection object. any help would be greatly appreciated.
thanks,
Scott
View 3 Replies
View Related
Dec 8, 2006
hi
As I trun Work offline - true, my connection manager for log file says-it cant acquire connection while work offline is true.Where as other oledb connections work fine.
Even it tried to get around by putting DelayValidation as true, but didnt work.
Is there is anyother setting that has be set.
Thanks and Regards
Rahul Kumar
View 6 Replies
View Related
Mar 15, 2007
I am looking to promote a SSIS package to various servers. The name and location of the text Log File setup in BIDS for the package is expected to change. The SSIS package will be executed through a 3rd party scheduler as a batch command file.
I am trying to use this command to change the location
dtexec /F DASD_Database_List_export.dtsx /L "DTS.LogProviderTextFile.1;E:Log.txt"
For which I am getting this error:
Description: The connection manager "E:log.txt" is not found. A component failed to find the connection manager in the Connections collection.
I tried Set command approach from
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72104
It did not work.
Has anyone been successful in using the dtexec log parameter DTS.LogProviderTextFile.1? Could you post how you got it to work? Thanks
View 5 Replies
View Related
Feb 11, 2008
I have a package with an FTP task in the Control Flow. Nothing complicated, its configured to download a file from FTP with overwrite true, and the get and download paths in variables. Once this step completes it goes to a sequence container that does stuff with the file, that part works fine.
The problem is if i run the package in debug mode using Visual Studio, everything works perfectly (even if run over and over). The problem occurs if i use my "driver" application to try and execute the package. All my driver does is use C# code to create an Application object, set the PackagePassword, LoadPackage based on the path and then .Execute().
Here is when the strangeness begins:. If the file exists in the destination path, then the FTP task fires. If the file does not exist (lets say i manually delete it after its being downloaded before using the IDE) the FTP task dose not fire and my Sequence Container fails to use the fail, since it is of course missing.
Monitoring the FTP server that i am running locally i can see commands firing when the file exists, but when the file is killed it never even tries to connect to my server. Very odd.
Am i missing something? Why would this work from the IDE but never from my driver?
Any help would be appreciated. Please let me know if any additional detail is required.
Dmitry
http://blog.lyalin.com
View 6 Replies
View Related
Jan 20, 2004
I am having problem creating/copying "txt" file in a remote machine by using the "exec master..xp_cmdshell" command in query analyzer. For example, we are getting errors for the following command:
exec master..xp_cmdshell 'copy d: estingauthors.txt \<MyServerName><myFolderName>authors.txt'
(but exec master..xp_cmdshell 'copy d: estingauthors.txt d: esting1authors1.txt' is working without any problems)
Any ideas?
View 7 Replies
View Related
Jan 20, 2004
I am having problem creating/copying "txt" file in a remote machine by using the "exec master..xp_cmdshell" command in query analyzer. For example, we are getting errors for the following command:
exec master..xp_cmdshell 'copy d: estingauthors.txt \<MyServerName><myFolderName>authors.txt'
(but exec master..xp_cmdshell 'copy d: estingauthors.txt d: esting1authors1.txt' is working without any problems)
Any ideas?
View 2 Replies
View Related
Jun 17, 2015
I'm working on SSIS to load the data from flat file to sql server, I'm getting date in below format, but in sql server I have given data type datetime. how to convert below format to 16-01-15 12.05.19.1234 AM.
View 4 Replies
View Related
Dec 1, 2007
Hi all,
I am currently on XP x64 and am trying to run a .vbs file, which needs access to an access file when the following error pops up:
"Provider is not specified and there is no designated default provider"
error code: 800a0ea9
source: ADODB.Connection
I have tried a bunch of stuff, but so far nothing has worked.
The following code is is question:
set AccessDB = CreateObject("ADODB.Connection")
AccessDB.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & sMSAccessDBPath)
any help would be appreciated......could I run this with cscript.exe (in the WoW64 folder) in through cmd.exe?
Thanks in advance for you help.
Jonathan
View 1 Replies
View Related
Mar 3, 2006
hi
I had a view in which I did something like this
isnull(fld,val) as 'alias'
when I assign a value to this in the client (vb 6.0) it works ok in sql2000 but fails in 2005.
When I change the query to fld as 'alias' then it works ok in sql 2005 .
why ?? I still have sql 2000 (8.0) compatability.
Also some queries which are pretty badly written run on sql 2000 but dont run at all in sql 2005 ???
any clues or answers ?? it is some configuration issue ?
Thanks in advance.
View 5 Replies
View Related
Jan 7, 2004
I am writing a pgm that attaches to a SQL Server database. I have an Add stored procedure and an Update stored procedure. The two are almost identical, except for a couple parameters. However, the Add function works and the Update does not. Can anyone see why? I can't seem to find what the problem is...
This was my test:
Dim cmd As New SqlCommand("pContact_Update", cn)
'Dim cmd As New SqlCommand("pContact_Add", cn)
Try
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@UserId", SqlDbType.VarChar).Value = UserId
cmd.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = TextBox1.Text
[...etc more parameters...]
cmd.Parameters.Add("@Id", SqlDbType.VarChar).Value = ContactId
cn.Open()
cmd.ExecuteNonQuery()
Label1.Text = "done"
cn.Close()
Catch ex As Exception
Label1.Text = ex.Message
End Try
When I use the Add procedure, a record is added correctly and I receive the "done" message. When I use the Update procedure, the record is not updated, but I still receive the "done" message.
I have looked at the stored procedures and the syntax is correct according to SQL Server.
Please I would appreciate any advice...
View 2 Replies
View Related
Jul 23, 2005
Hi!I scheduled a DTS-Import from MySQL, whenever I run it manually(Right-Click on the DTS package) it runs through without any problems.But firing it by a schedule doesn't work!?Just to exclude any issues regarding users/roles, I created a DTS toexport files to my desktop to an EXCEL-sheet. Manually export as wellas scheduled export works fine.My Application Log shows me following error message:Event Type:WarningEvent Source:SQLSERVERAGENTEvent Category:Job EngineEvent ID:208Date:6/8/2005Time:10:05:02 AMUser:N/AComputer:*****Description:SQL Server Scheduled Job 'ImportFromMySQL'(0xC89612CE034F6642BD585B048DBC0F06) - Status: Failed - Invoked on:2005-06-08 10:05:02 - Message: The job failed. The Job was invoked bySchedule 22 (ImportFromMySQL). The last step to run was step 1(ImportFromMySQL).Anybody know what's wrong!?
View 11 Replies
View Related
Jun 19, 2005
Hi guys,i want to make a scheduled job that inserts 10 user defined row each minute continously in enterprise manager
View 1 Replies
View Related
Dec 27, 2001
I have designed a DTS Package and it can be run successfully from Enterprise Manager. However, when I schedule the DTS package to run as a job then it fails with an error message of "Error string: The system cannot find the file specified.".
Anyone any idea as to why the job cannot find the DTS package?
Can it be something to do with SQL Server 7 and 2000 tools as 2000 Client tools have recently been installed onto my PC and the package and job ran fine when I had designed everything in SQL Server 7.
Thanks in advance
Vince.
View 1 Replies
View Related
Mar 1, 2002
Hi,
I am trying to do an automatic backup of my database and for some reason it does not do it.
I have it set to backup daily at 4:00 pm.
Please let me know if you know why it is not backing up on it's own.
The Server manager is on always and a manual backup is not a problem for me,
only the automatic.
Thanks very much.
View 1 Replies
View Related
Mar 12, 2002
Hello
I have a number of DTS packages which when run manually complete successfully however, when run as scheduled tasks they always fail. Can anyone offer any advice?
Many thanks
View 3 Replies
View Related
Jul 27, 2001
I'm thinking of using the SQL Agent Job Scheduler as part of a larger application and I'm wondering if anyone knows of a limit on how many schedules or jobs that can exist on a SQL Server at one time.
Thanks!
View 1 Replies
View Related
Aug 9, 2000
Hello,
I have many dts packages scheduled as jobs . job always fails when executed. It runs fine if i execute the dts package.
the follwing is the error message
Error: -2147217887 (80040E21); Provider Error: 0 (0) Error string: Errors occurred Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1 DTSRun: Package execution complete. Process Exit Code 1. The step failed.
any help would be welcome
thenk you
View 2 Replies
View Related
Mar 6, 2000
When I create a DTS to import data from Visual FoxPro it will work if I run immeadiately, but when I schedule it to run at a specific time it will Fail.
Any ideas why??
Thanks for any input,
Tom
View 1 Replies
View Related
Mar 24, 2000
I have a DTS that executes fine except when run as a scheduled event. Where can I research the error codes that occur below?
DTSRun: Executing... DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnStart: DTSStep_DTSExecuteSQLTask_10 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_10 DTSRun OnStart: Copy Data from FirmDirExp to [CG_Directory].[dbo].[FirmDirExp] Step DTSRun OnError: Copy Data from FirmDirExp to [CG_Directory].[dbo].[FirmDirExp] Step, Error = -2147008507 (80074005) Error string: Unspecified error Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 700 Error Detail Records: Error: -2147008507 (80074005); Provider Error: 0 (0) Error string: Unspecified error Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 700 Error: -2147467259 (80004005); Provider Error: -534709256 (E020FBF8) Error string: The Microsoft Jet database engine ca... Process Exit Code 1. The step failed.
View 1 Replies
View Related
Nov 15, 2000
hello All
I am trying to figure out a way , looking at the tables in MSDB (SysJobHistory) that if a scheduled job is running and not completed yet , for how long it has been running. I have to look for all the jobs with run_status = 4 (in process). But what i figured out it no history is written till the job is finished or cancelled. Can anyone help me with this
thanks
Alsi
View 5 Replies
View Related
Sep 6, 2000
Hi,
we run a nightly job processes, this job depends on the data entered from the frontend, since yesterday we have been entering lot of data in it, so the job that ran last night 10pm(09/05/00) is still running now and its next schedule time 10pm today(09/06/00), if the same job is already running since yesterday and if it still runs till 10pm today, will it starts again as per the schedule or it will not run, since the same job is running since yesterday.
Thanks,
Madhuker.
View 3 Replies
View Related
Oct 10, 2000
Hi,
I have a scheduled job that run one time a day at 10 pm. My problem is that if the job fail, i want that the job run 10 minutes after until it complete with success.
Any tips on how to do this
Martin
View 1 Replies
View Related
Oct 4, 2000
In SQL 6.5, when a scheduled job failed, you could see the error message in the history. In SQL 7.0, it simply tells you which was the last step to run. Is there a place which will report the actual error message generated by the task?
View 4 Replies
View Related
Sep 28, 2000
Hi All,
I have created a DTS package on a developement server that connects to our Exchange server and downloads customer service e-mail and inserts them into a table. This is done using a VB script.
When I right click on the job and execute it, it runs fine and we can see the mails after they show up in the table.
However, when I schedule the job to run at 15 minute intervals it fails with a vb runtime error. When I copy the job to my personal machine and schedule it, it runs just fine and again we see the mails in the table.
The server has the latest version of the scrrun.dll as well as IE 5.0.
I have messed around with this for 3 days now and have gotten MSFT involved as well.
Anyone seen this before? Any ideas or help will be greatly appreciated.
Brad Keck
View 1 Replies
View Related
Aug 20, 2000
I am running a scheduled DTS which transfers all the rows in a production table to another server every 30 minutes,each time it truncates the table on the second server before transfer.It has been running fine for several days.Will there be any problem in this kind of backup strategy? Do I have to clear any history logs frequently?Or any other problem can happen? Can anyone suggest any precautions,as there will not be any down time allowed.Replication is also not acceptable by the client.
Thanks.
View 2 Replies
View Related