I have made a SSIS package to create an XML file, which works fine in Visual Studio, but when I try to run in cmd prompt using dtexec /f "C:\OakeyCreek.dtsx" it throws an error
SSIS Package "TestOakey" failed with exit code: 1
In the package a sqltask gives resultset as XML and a script task creates the xml file.
I did some research, same package without script task run fine both studio and cmd prompt. I am suspecting problem with script task, because I have both VS2005 and VS2008 on the same machine.
Any idea how to resolve this problem ?
Exact error ms popup is ...
Registration information for this application needs to be updated.To update, log on as an administrator and run this command.
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTA.exe" /HostID SSIS_ScriptTask /setup
My operating system is Vista
Note: Edited to provide the answer!
So you've set up a SQL Server Agent job, and now you can't write to the file system. This is expected behavior, since SQL Server Agent uses SQL Server credentials to launch the job, not Windows credentials. So, what you'll have to do is this:
Under the Security folder in the Database Server in SQL Server Management Studio, find the Credentials folder.
Right click Credentials and hit New Credential.
Set up the Credential as you.
Expand SQL Server Agent, and right click Proxies, and hit New Proxy.
Set up the Proxy as you, using the Credential you just created.
Enable the Proxy to have the SSIS subsystem (if it's admin, check all of them).
Go edit the step on your job that calls the SSIS package.
Change the Run As field from SQL Server Agent to the Proxy that you just set up (if you did it right, it will be the only other choice in the dropdown).
You should be good to go!
Cheers,
Eric
You are creating the package using SSIS 2005, but running it using DTEXEC from SSIS 2008 - you probably have both SSIS 2005 and 2008 installed, and DTEXEC 2008 appears first in the path.
To use DTEXEC 2005, specify full path, like
"c:\program files\Microsoft Sql Server\90\dts\binn\dtexec.exe" /f Package.dtsx
In theory, DTEXEC 2008 should also be able to run the package (it should upgrade it on the fly to SSIS 2008 format), but there might be bugs and incompatibilities between the versions. Also it seems something is wrong with script task setup in SSIS 2008. Why would not you follow the instructions in the error message: logon as administrator and (using elevated command prompt) run -
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTA.exe" /HostID SSIS_ScriptTask /setup
Related
I'm having issues running a .dtsx package made in Visual Studio 2019.
In Visual Studio when using "Start without debugging" it runs perfectly with no errors, however when I try to launch the file from command line it's giving me a non-descript error and terminates the package.
It runs for some time and does execute a few of the tasks at the start of the package, however it does not get very far.
This is the "error" showing in the command prompt:
Message: <DTS:ProcessMemoryUsage xmlns:DTS="www.microsoft.com/SqlServer/Dts">DTS:PeakWorkingSetSize177860608</DTS:PeakWorkingSetSize></DTS:ProcessMemoryUsage>
When I look at the error dump, this is what I see:
This is my execution command
"C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" /f "C:\**PATH**\Visual Studio 2019\Projects\DataDropPrep\DataDropPrep\MSX DataDrop.dtsx" /conf "C:\**PATH**\Visual Studio 2019\Projects\DataDropPrep\Test.dtsConfig" /DECRYPT "****" /CONSOLELOG /DumpOnError /REPORTING EW
I don't understand why it works perfectly when run within Visual Studio 2019 but not in the commandline.
The package is set with target server 2016 (To match our SQL server).
I'm running the package from a local VM on my own PC, but the SQL server is deployed in Azure (cloudapp.azure.com).
I am NOT a DB admin, so I can't add the package to be run from the SQL Server itself unfortunately, wish that I could, would make my life a lot easier.
Alas I am stuck manually running this package every day from my own PC, and I'm trying to automate it with a .bat file, so I need this command working.
This is the package layout, it first truncates a staging table, then loads all items modified or created in the past 3 days, then deletes matching rows in the production table, then imports the new rows from staging. Repeat for all the different objects:
When using "Start without debugging" from Visual Studio 2019, it executes without issues:
Turns out the issue was that I was using a project parameter, which works when running from Visual Studio, but not when executing the dtsx file directly.
After converting the parameters from project to package, it executes successfully!
Without the logging and the insights that provided I wouldn't have known where to start.
Success
In the same folder as the package, SSIS generated a file SQLDUMPER_ERRORLOG.log. This pointed to a file in C:\Program Files\Microsoft SQL Server\150\Shared\ErrorDumps. This folder contains text files such as SQLDmpr0085.mdmp. When I click on this, it launches Visual Studio and gives an error message "The thread tried to read from or write to a virtual address for which it does not have the appropriate access."
After hours of experimenting and doing web searches, I discovered that I was not passing the correct package name to dtexec.exe. Once I corrected this, I was able to execute packages with no issues.
I have a fairly simple control flow with two data flows. The first one reads data from an Excel spreadsheet using a source script component and stores data into a cache transform component. The second data flow uses a source script component to read a text file, then uses a lookup component to verify that the text file contained the correct information. The No match output from the Lookup is written into a flat file destination. If I run the package in Visual Studio, either debugger or execute, everything works. If I try to run the package from the command line using dtexec.exe I get the following error.
Description: The component is missing, not registered, not
upgradeable, or missing required interfaces. The contact information
for this component is "Cache Transform;Microsoft Corporation;
Microsoft SQL Server; (C) Microsoft Corporation; All Rights Reserved;
http://www.microsoft.com/sql/support;1".
Other packages that don't use a Lookup component give a different error.
Description: To run a SSIS package outside of SQL Server Data Tools
you must install Enterprise Edition (64-bit) of Integration Services
or higher.
I'm using Visual Studio 2015 and SSIS 2016, and the project target server version is SQL Server 2016. I'm running dtexec.exe from C:\Program Files\Microsoft SQL Server\130\DTS\Binn\. Running dtexec.exe from c:\Program Files (x86)\...\DTS\Binn\ gives the same result.
Try repairing / reinstalling SSIS per your comment:
Integration services are installed but I can't find SQL Server
Integration Services on the services list. Something must have gone
wrong in the installation.
As per the Microsoft documentation on DTEXEC for executing SSIS packages:
When you use the version of the dtexec utility that comes with SQL
Server 2012 Integration Services (SSIS) to run a SQL Server 2005
Integration Services (SSIS) or a SQL Server 2008 Integration Services
(SSIS) package, Integration Services temporarily upgrades the package
to SQL Server 2012 Integration Services (SSIS).
Is there a feature to disable this aspect of DTEXEC utility when running SSIS packages?
My reason for this question is that I have a script task to rename some files in an SSIS package. This works just fine on my local machine and a coworkers local machine, but after deploying this SSIS package to our windows 2012 server with SQL Server 2012 installed I get an error message. I'm really confused, because I wrote this package in SQL Server 2012 Data Tools so this task shouldn't need to be upgraded/migrated at all, which is what the error is complaining about...
Warning: 2016-04-06 11:29:58.14
Code: 0x00000000
Source: DataMergeScriptTask
Description: Found SQL Server Integration Services 2012 Script Task "my_Script_task" that requires migration!
End Warning
Error: 2016-04-06 11:30:03.02
Code: 0x00000001
Source: DataMergeScriptTask
Description: Exception has been thrown by the target of an invocation.
End Error
Unfortunately we haven't found a solution for the Script Task not converting into 2012, as these packages are all written in Data Tools 2012 and opening/resaving the task doesn't seem to actually upgrade the script task in a way that solves it on the server.
My solution has been to take the C# script and turn it into a standalone .exe which has some command line arguments to pass our different parameters with defaults in place to match our current environment. Then I set this up to be executed by a Batch script called by a windows task scheduler job.
I'm hoping to find a real fix for this so that script tasks in larger packages will still be peachy, but that may take more time or a reinstall of data tools... Having multiple versions of SQL Server data tools/BIDS on my workstation could be a cause of this grief. More testing to come!
Just update the TargetServerVersion in your package to match the server version that you plan to deploy to.
Make sure you have a copy of your project in case it doesn't go smoothly. Then right click on the project name, choose properties, then drill into Configuration Properties -> General and update the TargetServerVersion.
Then rebuild and deploy. When the project builds, it should now be in the format that your server expects so it won't try to rebuild the script code on the server where references might not be the same.
I just added a new folder and several packages to TFS server from source control, and they do exist when checking from source control.
However, none of them could be found when I tried to build a Parent package and to locate those uploaded packages in SQL server. My operation is as follows:
1. Add "Execute Package Task" component, then double click to edit
2. Package Location: SQL Server;
Connection: XXXX;
Package Name: Here pops up a list of folders and package files but newly uploaded ones are not included.
"Connection" is filled correctly because old filefolders and packages (uploaded by other people) are listed in Package Name pop-up window.
So how could I configure my packages on TFS to make it shown from SQL Server package list?
P.S. I'm using Visual Studio 2008 and SQL Server 2008
You can't. As the documentation says:
The Execute Package task can run packages stored in the SQL Server
msdb database and packages stored in the file system. The task uses an
OLE DB connection manager to connect to SQL Server and a File
connection manager to access the file system.
The Execute Package task has no idea what TFS is or how to connect to it. If you really needed to do this, then you would have to write your own custom task that does know how to connect to TFS.
However I have no idea why you want to execute packages directly from TFS anyway, it's a source control system (among other things), not a package repository.
On our new server, when I try to run the SSIS packages from Integration Services in SSMS (ie by right clicking on the package and selecting "run")
I get the following error
The program has failed to Load the library "c:\Program Files\Microsoft SQL Server\100\DTS\Binn\dts.dll"
Odd - the dll file is at that address, the SQLAgent login (under which integration services and Sql Agent runs) has permission to execute the file, and I have permission to execute the file (meaning we both have full control on the folder containing the dll). I can't see any reason why integration services wouldn't be able to load the library
This happens with all packages on the server
Stopping and restarting services (SQL and SSIS) has not resolved the issue
Any ideas?