How can I change XSD Path in deployed SSIS Package - sql-server-2008

I am new to SSIS packages. I have an SSIS package Solution in my local machine.
It has an XML Source component which uses an XSD file in my local machine.
When I deploy this on my SQL Server, How can I set the path to a new location on server ?
Thanks

Create the XSD path using a Configuration variable. In this case, whenever you will change the configuration it will pick the new path accordingly.

I think this guide is what you're looking for:
http://fuzzy-group.blogspot.co.uk/2013/01/ssis-create-dynamic-xsd-source-file-for.html
It allows you to store your xsd in a database where it is configurable, and then loads it dynamically at run time.
I'm not sure exactly how much of an xsd change this can handle, but I think this is the closest you can get without dynamically generating the whole package.

Related

Using Configuration File instead of System Registry

The Portal UI React application makes use of the Registry settings instead of a local settings.json file in order to run the application on the local environment.This is a pain for the developer because everytime a Registry is updated the system needs a restart which is not a advisable kind of approach in this fast moving development world. There is less flexibility and more dependency while using the Registry settings instead of a local json based configuration file.
I propose to move all the configuration files into local json file and checkout the file in the applications repository.
If there is any other approach which would make this easy to use scenario then pls share your thoughts.
Thanks
Iftekhar

SSIS 2012 Passing Parameters / Passwords with Dont Save Sensitive

I have got a package and I want to pass username, password and server name via the Project Parameters. I managed to set it, deployed to SSIS Server and it run successfully in the server.
However, as soon as I set the Protection Level to 'Dont Save Sensitive', I couldn't run the package in my development PC anymore.
After changing that, the package cannot access to the Database anymore and Project Parameters are no longer tied to the package.
In SSIS 2008, we used Package Configuration XML files and by using that XML file, we can run in both Development and Live environment at the same time.
Is there anyway to achieve the same in SSIS 2012?
Your package needs to have a Parameter for each of the Project Parameters you are trying to pass.
Then your Connection Managers need to use those Variables - usually as Expressions to form a ConnectionString property.
You need to:
Store the password in a config file (not the best idea but it does work)
Store the project parameter as sensitive. Then you've gotta use things like the GetSensitive method to decrypt that data.

Is it possible to export/import all connections within SSIS?

Does SSIS 2012 allow to export all connections of a project for a further import into another project?
In 2012 SSIS projects, you now have 2 options. The classic, pre 2012 way which is referred to as Package Deployment Model. The new, default, model is the Project Deployment Model. This answer focuses on the Project Deployment model.
Before you begin any manual edits of files, use a version control system. While you can edit XML by hand, you need to have a safe recovery point in case you pooch the files.
In SSIS 2012, you can have Connection Managers scoped to packages as you've always done or they can now be a shared, project wide connection. Project connection managers show up in every package in SSDT, whether you need them or not. They are prefaced with (project).
If you've created a package Connection Manager that you wish to make into a project resource, simply right click on the CM and select Convert to Project Connection.
One caveat if you reverse that, the Convert to Package Connection is only going to create that CM in the current package. That's not such a hassle when it's 2 or 3 packages, but when it's 20ish, that gets tedious.
A Project Connection Manager has a physical file associated with it. In your project's folder, there will be .conmgr file for each connection manager. That defines the connection all the packages share. However, packages only "know" about the connection manager because of data in the .dtproj file.
If I wanted to re-use an existing project connection manager in a new project, I'd need to copy that file into my new projects folder. After that, I'd have to edit the .dtproj file and add that file's name in between the ConnectionManagers tag
<DeploymentModelSpecificContent>
<Manifest>
...
<SSIS:ConnectionManagers>
<SSIS:ConnectionManager SSIS:Name="PackageCM.conmgr" />
</SSIS:ConnectionManagers>
Now when SSDT opens the project file up, you should have a project CM exposed.
I don't think there's import/export connections utility in SSIS. You could, however, create package configuration file and include your connection managers in it. Then you can edit the file to run your package on different environment, or use values in it to update configuration file of another package.
resource:
http://msdn.microsoft.com/en-us/library/ms141132.aspx
Right click on the connection. Copy the connection Manager and paste in required package

SSIS: How to I specify the server for the file connection manager (specifying existing directory)?

I'm fairly new to SSIS and am having trouble figuring out something that seems like it should be straight forward:
On server A, I have 10 files in "C:\SourceFiles\Patients" (these files are PDFs). I know the names of these 10 files and they won't change. Also, there is a server B which is the DB server and is where the SSIS package will be located. My goal is to loop through a DB table containing patients, add some patient data to the 10 source files (renaming the file) and then save this new file to server A.
I have most of this running already. Currently, all of this is happening in a script task using ADO.NET for the DB access (I'm already accessing the DB table on server B) and I'm accessing the source files on my local C drive.
I am having trouble figuring out how to specify server A in the Package Configuration for the source files. I have a file connection which specifies an existing folder (C:\SourceFiles\Patients), but it only specifies the location of the folder NOT the server. How to I specify server A for this file connection? Or, how do I use this file connection with a server A connection? I'm having real difficulty grasping this for some reason!!
The technologies I'm using are:
Visual Studio 2008,
C# in the SSIS script task,
ADO.NET in the SSIS script task and
SQL Server Management Studio 2008 (SSIS package will be imported here).
Thanks for pointing me in the right direction!
I see some issues with what you are trying to do.
PDF is an image format (an image of a document) and as such is not easily manipulated by SSIS. Generally if you are acting on a file from within SSIS, it would be a flat file of some sort, like a CSV or some other text format.
Using a script task to do all of your work within SSIS is failing to use the power of SSIS properly. If all you have in your SSIS project is a script task, you should just be using C# or VB.net directly and not involving SSIS in your project at all.
That all being said, you should access your files on server A using UNC (Universal Naming Convention) paths. You will need to pay close attention to your permissions within SSIS to make this work. When an SSIS job runs, it runs under a specific user, usually the SQL Server Agent user, and that user will need permissions to access the folder on server A remotely. When all of these permissions are set correctly, you can use something akin to \\ServerA\ShareName\Patients\ as the pointer to your directory with pdf's in it.

Can someone suggest a better way to use configuration files in multiple environments

I want to standardize and parameterize values across multiple environments and not have to change the dtsx files at any point.
The pattern I am deciding to use is to run all packages from the DTEXEC program and to specify configuration file on the command line and put that all in a batch file. with a different batch file for each environment.
One requirement is the location for the configuration file cannot be in the same physcial drive location, ie all config files are in D:\SSIS\config files. The main reason is that the production machine has an E drive mapped and this is where the ssis packages live and operate from. And, the staging machine does not, and cannot have a drive mapped to E.
Also, we want all files to reside in same pattern across all environments. config files in one place, archive files in another, etc. And, to try to use one medium, meaning the file system is where we store the packages, config files and batch files, as opposed to having data and artifacts in the registry and environment variables.
Does anyone see a more direct approach that satisfies all the conditions?
There may not be one and I thank you for your time...
That's how we're doing it - all config files on the file system, running packages using batch files that call dtexec, and passing config file locations to dtexec via parameters.
Watch out for a possible nasty gotcha, though. As this Books Online article points out, dtexec's behavior regarding command-line configurations changed between SSIS 2005 and SSIS 2008.