How do I edit SSIS Script Tasks in Visual Studio 2019? - ssis

Using the SSIS Data Tools extension for Visual Studio, it is possible to carry out various operations in a straightforward manner. However VSTA and the Script Task are a major exception—specifically in VS 2019.
After editing an existing Script Task the script text will reset to the default value.
Creating a new Script Task (other than the default) is likewise impossible, as far as I can tell.
I have tried editing the base64 string in which the VSTA task is stored within my .dtsx files.
After that I tried manipulating the files and directory structure under the VSTA temp directory in order to persist changes in the scripting solutions/projects. I have also tried many other tactics, such as including the task implementation as an additional source file, as a binary reference, or via partial classes, a base class etc., within the Script Task.
But none of these approaches (even if they were to work) are necessarily maintainable or simple in the context of a team.
Is there any sustainable long-term alternative that allows Script Task development in VS 2019?

The SQL Server Integration Services Projects extension for Visual Studio 2019 has a fix.
Script Task creation and editing appears to be working as of version 3.2.1 of the extension.
This was apparently released some time in the past few weeks (as of date of writing, 26 November 2019).

Related

Is there a version-specific compilation symbol when SSIS compiles script components?

I have packages that use script components as a data source. Some of them override the PrimeOutput method from the Microsoft.SqlServer.Dts.Pipeline.ScriptComponent class. In 2008, this method has 3 parameters, but starting in 2012, it now has four parameters.
These packages are currently executing under SSIS 2008, but will soon be moved to SSIS 2014. I need to open these packages up and fix the issue, but I would like to do it ahead of time and still be able to deploy to SSIS 2008, but also have them work under 2014 when the new environment is ready without having to make additional changes when moving between environments.
If I could differentiate between environments at compile time, then I can get around this problem, but that would mean I would need to use preprocessor directives. I know I can define them in the script component's project file, but I'd like this to work in SSIS 2008 and SSIS 2012 without having to make changes to the .dtsx file.
Does anyone know if the various versions of SSIS define version-specific directives when compiling script components?

Linq to Sql Classes missing from within a script task in visual studio 2013 in an SSIS package

I'm trying to migrate an existing Visual Studio C# project to run in a script task in an SSIS package.
The current C# console application uses "Linq to Sql Classes" to generate a dbml file and the necessary classes.
But when I go to edit the script task in the SSIS PACKAGE I'm not able to find the LINQ TO SQL CLASSES. I right click on the project and select "add -> new item" and look for the "Linq to Sql Classes" item to add the dbml file to my project but it's not there?
Confusing because if I do the exact same thing in Visual Studio 2013 in a console application, I'm able to add the "Linq to Sql Classes". Does anyone have any ideas? I realize I could use Entity Framework but that would take a considerable amount of time to re-write everything. Also I've thought about just executing the console application's compiled executable from within the SSIS package but our database team will not allow packages to run executables.
Also I'm targeting the .net framework 4.0 for both the Visual Studio 2013 console applications and from within the Visual Studio 2013 editor in the SSIS Package Script Task.
I stumbled across this question because I have(had) this exact same problem. We had an existed DataContext file which had been mapped to a database. I had updated the database which SSIS but my changes werent being reflected in the Script task. I created a seperate project and created a linq-to-sql file and connected it to the same database as my Script task. Then added all the existing tables and the new one too. which generated a new Datacontext file. I then copied the code back into the original Datacontext file within the script task.
Hope this helps you and future programmers

How do I regenerate a DataContext.designer.cs file from a CC.Net build script

We use Linq2Sql and CruiseControl.NET. Visual Studio likes to rebuild the register any layout change on the DBML designer as a change to the DBML. This forces it to regenerate the DataContext.designer.cs and DataContext.layout files. This, in turn, causes spurious conflicts with Subversion when we go to commit.
I would like to svn:ignore the .designer.cs and .layout files to avoid the conflicts, and let our CI server generate them as part of the build process. MSBuild, which works well for building the rest of our project, does not generate the .designer.cs files.
Normally, those files are built upon save of the .DBML within Visual Studio using the custom tool MSLinqToSQLGenerator. I need to be able to do it unattended without running Visual Studio.
How do I do this?
Based mostly on this question, but also this question, this question and my own experience, I don't think it's possible without a lot of ugliness, pain or without converting your LINQ to SQL code generation over to T4 (not appealing, IMO).

How to create a MS Word document using SSIS package?

Using Script Task, I have written a code to create a folder and create a MS Word document inside the newly created folder. It is working on the local machine but it is not working on the server where the package is deployed to. The folder is created successfully, but the Word document file is not created. For Word document creation, I had to refer another DLL where I had included an additional namespace Microsoft.Office.Interop.Word. Is there anything else to do before deployment ?
Based upon rfonn's comments, your choices are as follows:
Install Word 2007 on the server.
Re-do your package on a dev box with Word 2003 installed and deploy to your server.
Use some other tool to generate the Word Document.
SSIS is generally used for movement of data, so while it is possible to do what you are doing, it is likely not the best tool for the job. If you are capable of writing code in a script task to do what you want in SSIS, it is possible to write a program (VB or C# or any other tool you choose) to do the same thing without SSIS being wrapped around it. My money is on option #3 being your best choice.
I guess you missed installing the Office PIA.
After installing the relevent PIA according to your Office version, add a reference to microsoft.office.interop.word (.NET) file in your project (ssis script in VS).

Comparing SSIS package code...any suggestions?

I've hit the inevitable state where I have to do a diff on the code within two versions of a SSIS package.
What have you used successfully other than what I'm going to do now by opening up 2 instances of VS and go over it box by box and variable by variable?
Note: The things that are important to compare in my case are:
Variables
Code in Execute SQL Tasks
Order of Tasks
Data Flows
Order of data flow components
Try BIDS Helper. It prepares both versions by normalizing whitespace and splitting long lines before making the comparison. Most changes can be easily recognized.
A Visual Studio extension has been deployed in March 2017 to Visual Studio Marketplace. It is called SSIS Compare and Merge Tool. You can install it using Tools menu than Extensions and updates and search for online extensions or download and install the .VSIX file from Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=TamasTIPost.SSISCompareMergeTool-18170
There are some utilities that will do this:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.sqlserver.dts&tid=0619e97f-4dd4-4946-bd41-888e751a5d72&cat=en_US_2b8e81a3-be64-42fa-bd81-c6d41de5a219&lang=en&cr=US&sloc=&p=1
ApexSQLDiff
Randy
I use Notepad++ to compare dtsx (xml) files. Some times even write some code to extract components for example to extract all SQL stored in a large SSIS package with dozens of ExecuteSQL tasks.
UPDATE: Just found this Bi xPress. Here is a video explaining how it works
Updated with the latest locations and consolidated the different answers.
There are a number of tools that try to help managing, comparing and merging SSIS and other otherwise difficult to merge file formats favored by SQL Server Analysis Services, Integration Services and reporting services.
Putting SQL code in stored procedures and managing these using SSDT and Git/TFVC is a useful first step. For the more exotic file formats extend your toolbelt with additional tools like:
BI Developer Extensions (formerly BIDS Helper) free!
Apex SQL Diff Pro
Bi xPress
SSIS Compare Merge Tool
Each work slightly differently and the cost varies, but they all apply normalization and visualization to help you understand and potentially merge the differences between these files.
Aside from that, many changes may be possible with enough understanding of the XML using tools like Notepad++ or Araxis Merge. Many merge tools now have have special XML compare/merge capabilities where you can configure how files should be normalized prior to comparison.