We have a task where we need to automatically convert an excel file to a csv to prep it for loading into a SQL database. The developers built this process into a SSIS package. For the conversion, they initially tried to have a task in the SSIS package execute a VBscript to convert the file. When they were running this on there local machines, this worked correctly. When they ran the package manually through VS on the server, it ran correctly. When they ran the package manually via the Integration Catalog it ran correctly. We did this both as our accounts and as the service account and got the same results. However, when we scheduled it as a job it would hang on the part of the process that executed the VBScript. No errors, it would just hang until you killed the job.
The job was executing as the service account which has full admin access on the server, explicit full access to the share where the files are stored and converted (which is on the same server) and full admin access to SQL. The job owner is set to sa which uses the service account. And all the job does is execute the package from the integration catalog which works if you run it independently of a job. When we compared the ssisdb execution report for the manual run in the integration catalog using the service account to the job run they looked the same except the job hung on the conversion task and the other did not.
After spending some time trying to figure this out, the developers tried a different solution. They changed the conversion script from using VBScript to using C#. They ran the package from there local machine and once again the package worked. This time when they ran it manually on the server it failed. When we ran it from the integration catalog it failed and when we ran it from a job it failed.
The error we keep getting is "Create CSV file: Error: Exception has been thrown by the target of an invocation" After spending several hours looking into this error nothing suggested seems to be working.
We also tried these same solutions on a newly built server to make sure we weren't dealing with an odd configuration setting that could have been changed (It is a Dev server) and it still failed there.
At this point, we are pretty lost at what is happening. The first solution worked, but for some reason would never work as a job. The 2nd solution works everywhere except when ran on the server.
We are looking at some other solutions to try to get around this. The next thing may be trying to using powershell to convert the file, but not sure if that will bring us back to the same issue. Any suggestion you guys have will be greatly appreciated
Also, we are using SQL Server 2012 dev edition, VS 2012 pro, Windows Server 2012 R2
This might be because of a bug that Excel has when trying to run jobs (that use Excel) and no user is logged on a specific machine. This might affect also the excel library. The solution is to create the following 2 folders:
C:\Windows\SysWOW64\config\systemprofile\Desktop
C:\Windows\System32\config\systemprofile\Desktop
and then restart the machine. :)
(Edited to show that a restart is needed. thanks for Dustin for checking this)
Related
I have an SSIS package that uses the Execute Process Task to run an application. Running on my local visual studio has no issues. Running it on the server as a job, from the logs, I can see that it just hangs on the EPT step. It never errors or stops.
The old version of the application runs from the same directory as part of a job on a server with no issue. I'm simply just running a new version of the application. It does pass arguments slightly different though.
I log into the server as the SQL Agent service account and run the executable commands from CMD the same as the SSIS package runs it, and it runs fine.
The task is configured with default configurations except for the window is hidden, the same as the old version that works.
I've seen many people have this issue and have tried everything..
I'm assuming that it's prompting me something when it runs on the server. Is there any way to see what it's prompting if I am logged into the server running the job?
I wanted to learn SQL to create my own database to serve for my future project but things seem not to be smooth as expected from the first step. I struggled with installing the SQL Server for days with different times of uninstalling and reinstalling. The installation Progress has just constantly thrown me warning window with the content was:
The MOF compiler could not connect with the WMI server. This is either because of a semantic error such as an incompatibility with the existing WMI repository or an actual error such as the failure of the WMI server to start.
I believed that the old SQL Server was completely uninstalled by deleting anything related thing include files in Program Files, Program Files(x86), and its registry.
I searched and followed many threads with the same issue on some forums but still got no result.
After skipping that warning by canceling it, the installation completed with failure shown in the picture below. Your help would be much appreciated.
I have sql agent jobs which call certain Stored Procedures based on some condition. The logic was implemented in powershell. Recently all the powershell jobs in sql agent started failing with error message:
The step did not generate any output. Process exit code -2146232576. Anyone have insight on this issue?
Edit:
Around the time the jobs started failing following entries are registered in Windows evenlog setup:
Initiating changes to turn off update MicrosoftWindowsPowerShellV2 of package PowerShell-V2-ServerCore. Client id: DISM Package Manager Provider.
Selectable update MicrosoftWindowsPowerShellV2 of package PowerShell-V2-ServerCore was successfully turned off.
I'm not familair with Operating system level changes.Could anyone interpret what's going on?
The answer is that the SQL Agent is using the PS v2 Engine to execute your scripts and your server admins have disabled PS v2 using DISM. Yes your scripts will work fine in ISE because they almost always are backwards compatible with newer versions of PS 3,4,5,6 etc. The SQL Agent job is running a command before your scripts telling Powershell to use the v2 engine, which the feature is no longer installed.
I'm working on a domino server version 8.5.3 and I am calling a java agent A that makes another java agent B run on the server. Java agent B references a Java Script Library where most of the code is.
I've chamged the code in the Script Library, saved the script library and the agent separately. There are no compilation errors that I can see.
When I run the code (either directly agent B on the notes cliet or agent A on the server), the old version is running (I know because of a cunning system.out.println()).
It's driving me mad for two hours now. I've tried closing down client and designer, restarting the server, shutting agent manager off and then on, all to no avail.
Is there some magical cache which I could clear?
I solved the problem by starting both the script library and the agent from scratch, renaming everything in the process. What a pain.
I'm looking at versioning databases and came across the usual articles regarding how to do this (coding horror, ode to code, etc). This all make perfect sense to me, however I'm trying to find a script runner that will run the sql scripts for me. All these articles mention having something to run them automatically, but none of them make any recommendations.
Does anybody know of any utilities for running these scripts? Ideally something that works in the following way:
Runs everything in a transaction so if any single update fails, the whole thing fails
I have control over the name of the scheme version database table
Ability to have a series of scripts that are always run if an upgrade takes place
Can be run as part of an automated task
EDIT
Open Source
We Use DbUp as Script Runner in our Web Project. Its simple and nice open source tools that help you to write you own script runner with Console Application fashion.
DbUp is a .NET library that helps you to deploy changes to SQL Server
databases. It tracks which SQL scripts have been run already, and runs
the change scripts that are needed to get your database up to date.
we can run scripts from folder in filesystem or you can embed them to your assembly and run them as embedded scripts.
you can find more information and sample on their code repository on github.
http://dbup.github.com
Check out SSW SQL Deploy - it would appear to do just about all you're asking for. It keeps track of already executed scripts, it'll run a whole batch of scripts at once and on multiple servers (if required), and so forth.
It's a pretty simple, but nifty tool - highly recommended!