I have a custom EXE written in C# (I didn't write it). It retrieves data from MongoDB and writes six CSV files to the same folder that it resides in.
I can double-click on the EXE and run it -- I do need to run it as an administrator. I have its administrator privileges set in the properties, so it always runs as administrator. It pops up a window with some status messages, then closes without prompting after creating the files.
I have the same EXE listed in an "Execute Process" task in SSIS (VS 2015, pointed to SQL Server 2012). When I run it, it pops up the same cmd window, gives the same status messages, closes without prompting, and continues to the next step in my SSIS package... BUT it doesn't write any files.
I gave "Everyone" permissions to the target folder, which doesn't seem to have helped. What do I need to do?
When the process is launched from SSIS, it's not being run from the same folder as the executable. That's pretty typically of any software executing an external process.
Fortunately, you can set the "working folder" option within the Execute Process task properties. If your executable is written to write to the current folder, it should work.
Related
I have built a package that downloads one or more files from an FTP site to a local directory, deletes all from the FTP, then imports the files into SQL, timestamps the files, then moves it to an archive directory.
Because there can be one or more files I used variables for both source and destination, and put the various tasks in FOR EACH loops.
In BIDS it works fine, but when I run this from SQL Agent, it fails saying
FTP Task Directory is not specified in the file connection manager
Control Flow
Error screenshot
Why would it run successfully in BIDS but not when scheduled as an SSIS job?
I want to simply open an MS Access MDB file with task scheduler, but it just says "running" and leaves MS Access open in the background which I can only see in the task manager.
I have an AutoExec macro that does it's thing and then closes itself. Works fine opening the program manually, doesn't do anything when opened from task scheduler (Including clicking run on the task myself).
I've seen many ask this online, but have found no solutions.
Here's what I have in the Task Scheduler:
Program/Script: "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"
Add arguments (optional): C:\[TheDirectory]\SCServerData.mdb
I have other Task Scheduled .bat files that run with no problem.
Turns out it's quite simple actually. I just put the command in a batch file instead and run that with Task Scheduler. Seems to be working so far.
This issue was addressed in a prior post, and I have a very similar situation, however it is sufficiently different that a new post is justified.
I have an SSIS package with a For Each file loop. In Visual Studio 2017, the package behaves exactly as expected in debug mode. However, once I deploy the package to my SQL server and run it from there, I receive "The For Each file enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory is empty." The package itself exits with success, this error logged as a warning, and suffice to say, my target table remains empty.
Unlike the previous poster experiencing this issue, I have been using a UNC path for my source folder (values genericized):
I have validated that the SQL Account and SQL server itself have rights to my target share and files. I have changed the Integration Services service to use a known good domain account. I do not see any access denied errors, etc. What am I missing?
UNBELIEVABLE. Here is the answer. While I can run the SSIS package in dev from VS2017 on my workstation, once published to the SQL server, the job fails if I execute it from SSMS on my local workstation. However, the job succeeds if I run it from SSMS on the SQL server itself. Same domain, same accounts, same DNS. Ughh. I sure hope this saves someone a few gray hairs.
Background
Created package in BIDS.
Deployed to SSMS
Package writes files to a CSV file in a network fileserver.
The default name of the package's flat file destination is $path\workcsvout.csv
Package derives filename from an expression
Issue
When I configure and run from SSMS, it fails with Error DFT -Extract to File:Error:Cannot open the datafile "........\DerivedFilename.
Troubleshooting
Verified the file exists in directory - used flat file destination temp filename, before derived filename - still failed
changed name to file it was trying to open - still failed
I am running job from my login in SSMS, via SSISDB - Projects - Package - .dtsx package - Execute
See pictures below and advise if more information is needed.
Thanks
Ensure Visual Studio isn't open after attempting to either run the package directly from the Integration Services Catalog as I have found that VS can hang onto a connection to the files you are writing to and it can throw similar errors.
Ensure the account configured for the package has sufficient permissions in all the areas it needs to write to.
After VS is closed and permissions are all set in step 2, try executing the package directly inside the Integration Services Catalog in SSMS. If this works, move to step 4. If this doesn't work, troubleshoot the errors and ensure security is all setup properly and you are executing the package with the same account.
If you are here, I will assume you want to schedule the package. Ensure that the owner is the same account used in step 2. Check the "Run As" account in Step in the job, if that account is not the same as step 2 then you either need to make it the same or give that account the same access as the account used in step 2.
I went through this troubleshooting process and it solved my issue. I also was building files on a general UNC file path like \servername\folder\folder without needing to do any local business with \servername\d$\folder\folder that other people recommend.
I would check to make sure that your SQL Server service account has full rights to the landing folder.
After experiencing the same issue as you, I finally checked the folder permissions that were created for our SQL Server service account. Come to find out that it was missing the "Full Control" and "Modify" folder permissions. Once I granted these to our service account, the issue went away.
Folder Permissions Dialog Box
Troubleshooting:
Can you try to create file on local and then move the file using File System Task.
I was trying to pump the data which is in csv file.
Closing the visual studio and closing the csv file which was opened in another machine resolved the problem
I am relatively new to SSIS packages Package is a File system task to rename and move a file.
Package runs correctly from SSIS store but whe I run it as asql server agent job it doesnt move or rename file but shows successful. What am I doing wrong
When executing the package from the store, you are likely executing the package under your own domain credentials, which probably have permissions on the folders/files impacted by the package.
When executing from the server agent, it likely does not have those same permissions on the files/folders. That would be the first thing I would check, but having additional information as to the resources being manipulated and user accounts used could potentially shed more light on the situation.