Package part debugging is not supported when starting SSIS package - sql-server

This very strange issue. When I press the start button to execute the SSIS project it shows "Package part debugging is not supported" and nothing else. I create a control flow with the data flow task and execute SQL task. I have a simple use case to count rows using variable and store package names and the number of rows in a table on the SQL server. When I open error list it shows
Error saving PackagePart1.dtsxp: Control flow package part need to contain exactly one executable.
C:\Users\pcp\Documents\Visual Studio 2015\Projects\Transformations\Transformations\PackagePart1.dtsxp
.

Try to change the Debug to Release mode in Visual studio, build and Retry.It worked for me.

Related

SSIS Project Failing When Running As SQL Server Agent Job

I have designed a SSIS project and deployed it to SQL server and also created the job to run on daily basis but its giving me this error when executing this as job (doesnt give any error within VS):
There is this CLSid in this error message but there is no application associated to it in
--> Component Services -> Computers -> My Computer -> DCOM Config
But this CLSid is registered inside registry editor
About this particular task on which this error is occurring: This is a script task which is modifying and deleting the un-wanted rows from the excel file in which I am trying to write SQL table data.
Script task code looks like this:
I have been working for hours now trying to fix this problem but no success. Kindly guide me how can I fix this issue. If any other information is required related to this project, please let me know....
Doing Excel automation in a SQL Server agent job is totally unsupported and probably won't work.
To have even a ghost of a chance of making this work you'll need to run a real desktop session on the server and automate Excel in that. Excel expects a real user to be logged in with a full profile. And Excel has failure conditions where it displays a popup window, which you'll need to be able to access via remote desktop.
You can read and write Excel files on a server with the OpenXML SDK, without actually having to run Excel. There's also a wrapper library called ClosedXML which you may find easier to use than using OpenXML directly.
tl;dr;
You need to install Office (Excel) on the server AND ensure that you install it in a manner that mirrors the SQL Agent's expected bit-edness. Default for Agent is going to be 64bit, default for Office is still 32 :(
Error guessing
You have a script task that uses the Office interop libraries to delete some rows (2 through 11?) out of a spreadsheet.
You have Office installed on your machine and therefore you have the libraries installed. Excel still has COM based "stuff" in it, thus the interop and errors shrieking about the CLSid, registry, etc but that's likely just secondary errors because there is no base "application is not installed" exception to be thrown.
If Office is installed, then ensure your agent execution model matches the version of Office. If 32 bit Excel is already installed, don't potentially break everyone else's stuff by uninstalling and reinstalling as 64 bit, just got the Advanced section of the SQL Agent Job Step and check the 32bit box.
Once all that's done, then if you're still getting errors but new ones, then the existing comments mentioning permissions may come into play - it depends on where the Excel document actually exists (on the computer where SQL agent can access vs on the computer where it cannot vs networked drive)
Good luck in not finding people on the sanctions lists.

SSIS Foreach Loop Container to read files and load into DB getting crash during execution

I'm trying to load multiple files from a location into DB using Foreach Loop Container & DataFlow task in SSIS.
It's getting crashed while I try to execute the package. It's not giving any error message, whenever I execute the package it crashes and closes the visual studio app immediately. I have to kill the debug task in the task manager for the next execution of the package.
So I tried the below steps:
I used a FileSystem task instead of DataFlow task to just
move all the files from the source to the archive directory, which ran
fine without any issues.
Ran the DataFlow task individually to load a single file into DB,
which was also executed successfully.
I couldn't figure out what was going wrong here. Any help would be appreciated! Thanks!
Screenshots
All screenshots look fine to me. I will give some tips to try to figure out the issue.
Since the File System Task is executed without any problem, there is no problem with the ForEach Loop Container. You can try to remove the OLE DB Destination and replace it with a dummy task to check if it causing the issue. If the issue remains, it means that the Flat File Source could be the cause.
Things to try
Make sure that the TargetServerVersion is accurate. You can learn more about this property in the following article: How to change TargetServerVersion of my SSIS Project
Try running the package in 32-bit mode. You can do this by changing the Run64bitRuntime property to False. You can learn more about this property in the following article: Run64bitRunTime debugging property
Running Visual Studio in safe mode. You can use the following command devenv.exe /safemode.
Workaround - Using Bulk Insert
Since you are inserting flat files into the SQL database without performing any transformation. Why not use the SSIS Bulk Insert Task. You can refer to the following step-by-step guide for more information:
SSIS Basics: Bulk-Import various text files into a table
As mentioned in the official documentation, make sure that the following requirements are met:
The server must have permission to access both the file and the destination database.
The server runs the Bulk Insert task. Therefore, any format file that the task uses must be located on the server.
The source file that the Bulk Insert task loads can be on the same server as the SQL Server database into which data is inserted, or on a remote server. If the file is on a remote server, you must specify the file name using the Universal Naming Convention (UNC) name in the path.

SSIS Script Tasks losing code

I have a very strange issue happening that is causing Script Task code to clear out. I have been able to test on 2-3 different machines. We are running SSDT 15.4 preview. The steps to reproduce were as follows.
Create a script task inside of a foreach loop container.
Create a comment in the script task.
Change or add a variable mapping in the foreach.
Save package.
Close the package.
Open the package.
Open the script task and the comment will have vanished.
As my last attempt for success,I have upgraded to 15.5.1 and the problem still exists.
If you close/Cancel the Script Task Editor form in Visual Studio after editing code, the code will not save. This will occur even if the code was saved in the other Visual Studio editor - the one where you edit the code.
You MUST click "OK" for the code to save.
If there is some error in the script it is not saved. Check your script for errors in the menu Build / Run Code Analysis on Solution or pressing Alt+F11
I had something similar. All code was being stripped when I imported the packages into SQL Server. For us it turned out SSMS was silently stripping code with an incompatible DTS version. SSMS v18 was removing scripts built with DTSv14. Once I opened them in a new version of Visual Studio, moved one "block" 1px over, then saved, it changed the package to DTSv15, which then imported fine using SSMS v18.
Just to verify, I tried using SSMS v17 with the DTSv14 package, and the Script Tasks were left alone and imported fine. But for other reasons we need to be using SSMS v18.

Visual Studio 2017 SSIS Error (0xc001f041)

No matter which SQL Server version I use I get the following error when I try to drag common tasks (like Send Mail) into the Package:
Failed to create the task.
Cannot create a task from XML for task "", type "" due to error
0xC001F041 "Cannot create a task from XML. This occurs when the
runtime is unable to resolve the name to create a task. Verify that
the name is correct.". (Sequence Container)"
I have no clue as to why that is happening and couldn't find any information on the internet either.
The strange thing is that I can drag the same tasks into the package when I use solutions that we've developed based on Sql Server 2008 R2 years ago. Restarting the machine didn't help. I could try to repair the Visual Studio installation, but I don't really want to lose all of my settings, extensions and such.
Apparently it works fine for a colleague. I deleted all .tbd-files in AppData/Local/Microsoft/VisualStudio, but neither of those files gets recreated when I start Visual Studio. I also tried to restore Toolbox defaults.
Executing the following command didn't help either. The same error is still appearing whenever I try to drop about 3/4 of the tasks into the package.
devenv /ResetSettings
devenv /setup
devenv /resetskippkgs
devenv.exe /InstallVSTemplates
Apparently the only thing that actually helps is to repair VS.

Visual studio 2010 sql project - how to run?

I have a SQL project in my .Net project in Visual Studio 2010. I added it to my solution because I thought it will help me to create all the database objects in more environment without difficulties.
My scope is to create/define the database objects (tables and stored procedures) in more computers, easily.For this purpose I created an Sql project in visual studio and I added for each table and stored procedure the creation script in this project. Now I have 30 scripts and I'd like to run it on a new sql instance.
If I open each sql file I have, in visual studio, an toolbat that allows me to tun the opened file on a sql instance (I have an connect button) and this generates the proper object (table or SP).
The question is: how do I do to run all the files in this project in one click. How to create all the objects in one click? Now I have about 30 scripts to run, and I need a proper way.
The way I tried to do it was to set as default project the sql project and to press run (F5), but then I got some strange compilation errors in sql files, errors witch didn't was there when I run (execute) each script individually.
Here is the right click menu for this project (No Run, Publish or something else!):
I tried to use from that menu the Deploy command. The bad news (for me) is that I got this on that command:
I don't have any error in my sql scripts, each one runs correctly.
Thank you.
Use need to deploy your project onto a database thus use the Deploy menu item.
The way database projects work, is that they compare the schema in the project to the schema at the destination.
What this means is you shouldn't have an use statements, or alter statements, ect...
What does one of those procs look like that is throwing the error?

Resources