SSIS Relative File Path for referencing .dtsx files on a execute package task - sql

Hi I have an SSIS package in which i have a main package that references child packages, is there a way I can make the location path external using a Relative path or just the file name. I cant use the full C: drive path as this is subject to change.

yes, but you have to find a way of changing the current working directory of the execution of the package. I worked at one place where we ran bat files to execute the packages and the first line used cd to set the working directory to the folder location of the parent package. I think I've also seen people use a script task inside the parent package to set the working directory based on the runtime location of the parent package.
http://www.artisconsulting.com/blogs/greggalloway/2008/7/13/relative-paths-in-ssis

from what i found it is best to use the project reference system instead of file reference and you can reference any project file if you deploy to the SSISDB instead of the MSDB, it works much better than the MSDB as well as being able to work with package params easier

Related

Extracting MSDeploy Zip package using variables

I’m setting up an automated build in VSTS that will FTP the published files to my server.
I have this working but the way I’ve achieved it, I feel is hacky and non-sustainable.
the process as you can see from the screenshots will publish the artefact which consists of a readme, cmd file and a zip containing all my publish files and then I extract the ZIP with the very explicit location below.
$(Build.ArtifactStagingDirectory)\temp\Content\d_C\a\1\s\IntermittentBug\IntermittentBug\obj\Release_EukHosts\Package\PackageTmp
I’m using a hosted build server in VSTS but as the path contains
d_C\a\1\s\
I assume this will change in time. What I need is a variable to cater for this path so it will always succeed.
How can I update this to make it more efficient and sustainable?
First, as jessehouwing said that the variable is called Build.SourcesDirectory.
Regarding the path structure, the simple way is specifying /p:PackageTempRootDir="" msbuild argument in Visual Studio Build task to remove the source path structure, then the path will be like Content\D_C\PackageTmp.
On the other hand, you also can publish the web app through File System mode.
This variable is caught in a predefined variable called Build.SourcesDirectory. see the complete list of predefined variables here.
In your batch or powershell scripts this variable is available as a environment variable called %BUILD_SOURCESDIRECTORY% / $env:BUILD_SOURCESDIRECTORY.

What is the default path in .desktop files and how to change?

I am installing a package manually on my own system because I need to make some changes to it that aren't available in the basic version in my package manager. I also am trying to keep packages installed locally if possible, so I'm installing it with prefix=$HOME/.local instead of the more common prefix=/usr/local.
When I do this, I have no problem executing the program from my terminal, because I added ~/.local/bin to my PATH and the package was installed with relative paths to its shared libraries (i.e. ~/.local/lib/<package>). Executing from the command line is no problem, but I want to be able to access it from the favorites menu in gnome, and for that I need to make use of the <package>.desktop file.
I could hard-code the path to the executable in the .desktop file itself, but when I pull a later version down and re-install it, I'll have to redo those steps. I was wondering if there's a way to avoid that.
I've tried symlinking the executable to a directory where .desktop files do have included in their path, and the application is correctly treated as a GUI option, but launching the executable results in an error trying to find a shared library. I think this has to do with how cmake handles rpaths, which to my understanding is a way of relatively linking executables with their required libraries.
I think what I want to do is have PATH inside a .desktop file include ~/.local/bin, without changing the .desktop file itself. Can I alter the 'default' path used in accessing a .desktop file?
The answer to my question was found in the Archwiki:
Specifically, I needed to add ~/.local/bin to my path in ~/.xinitrc. Now my graphical programs work as expected.

SSIS Deployment Variable Issue

I have created an SSIS package which uses a for each loop container and an Excel connection string that I have created from a variable so I can loop through multiple files. My package works without issue and if I have a number of files in my source folder and I simply execute the package it works perfectly looping through all the files doing what I want it to do.
The issue I have is when I deploy the package, If I have files within my source folder it executes without error but when you look at the source folder it still has the files in. When digging a bit deeper in to the package reports it looks like it is reporting that there were no files found. If I manually execute the dtsx file in runs without issue and imports everything as it should.
Is there any reason why after deploying the package it is unable to recognise the files or the variable that I store the file name in?
Sounds like it could be permissions related. Does the SQL Server Service account have permissions to the directory where the files are stored?

Change XML configuration path for all packages

I have defined SSIS package configuration to XML and configure it for 50 packages. The xml path for those packages were
H:\SomFolder\Configuration\XMLConfig
but in production server we don't have H: so I have created a folder on D:
D:\Configuration\XMLConfig
How can I change all packages to now refer to new path without opening each and every package and manually configure them?
You have hard-coded the xml config file path in each package and relative folder path of files is same for each package as per my understanding. Simple way is to loop through each ".dtsx" file (SSIS package) and find the string DTS:ConfigurationString="H:\SomFolder\Configuration\XMLConfig and replace it with DTS:ConfigurationString="D:\Configuration\XMLConfig with some simple program. Then, you can open the project\s having these SSIS packages and save it which will be ready to deploy on production.
This is general problem people face while developing the SSIS packages. Better way to avoid this issue is to store the xml file location in environment variable, so that you can keep the config files on different location on different machines and environment variable with same name will be present on those machines with different file location.

Nuget: Is there a transformation token available to get the location of the package tools folder?

I am trying to use Nuget to distribute a ms build .targets file. I need to modify some elements of the file to include the installed path of a few assemblies. For that I would like to use the tools folder. I am having a hard time finding the token (if it exists) to do the replacement. Has anyone encountered this problem or know of a workaround?
http://docs.nuget.org/docs/creating-packages/configuration-file-and-source-code-transformations
You'll have to go the PowerShell route to get this done, as no transform exists AFAIK. The init.ps1 file can process some parameters provided by the NuGet VSIX.
Simply add the following to the top of the init.ps1 file and use the $installPath variable in your scripts that modify the file content.
param($installPath, $toolsPath, $package, $project)
Check here for an example usage.