SSIS Project Level Connection Manager Property configurations - configuration

I have just started looking at using the SSIS 2012 Project Deployment. One thing I have noticed is that once the project is deployed all the properties relating to the project level connection manager get deployed too and hence need to be configured (Linked to SSIS Environment Variables).
Was just wondering whether the SSIS environment is smart enough to infer the ConnectionString property from the InitialCatalog and ServerName properties. That way I would only need InitialCatalog and ServerName Environment Variables and not a third variable containing the actual connection string which would result in a duplicate configuration.
Please see screenshot below showing an example of this.

If I got your question right, you want to set the initial catalog and server name property paramatically.
Here are the steps to do it: [Applicable for SSIS 2005 and above]
Step-1: Create two variable in SSIS package (Package scope) and name them DbName, ServerName
Step-2: In connection manager, create a OLEDB connection and test connection.
Step-3: Now, right click on the connection manager and click properties.
Step-4: In properties, click expression. You will see below window. In this window select initial catalog
Step-5: Now click on expression and drag drop DbName (i.e. your catalog name) variable from upper left window to expression text box and evaluate it.
Step-6: Do the same for Server name. and you are done
Remember: If your initial catalog and database parameter name are not
correct then you may face connection issue.
Other way, Specifically for SSIS 2012 and above
Now, as you have mentioned SSIS2012. Let;s utilize its feature of Project parameter
Create project level variables, You can either create two variable names [DBName, ServerName] or complete connection string.
Create OLEDB connection in connection manager and right click on the connection. Then select, "Parameterize"
Based on your parameter, you can set parameter to properties like Initial catalog, Server Name, Connection string etc. Or you can create project level parameter from here by selecting appropriate values, as shown below
Read this link for more details

I tested several combinations of ConnectionString, InitialCatalog and ServerName. It looks like servername (DataSource) and initialcatalog have to be in the connection string and the initialcatalog has to have a value. If I left servername blank it worked as long as DataSource was in the connection string.

Related

SSIS 2012 connection manager red arrow

I have project where there is allready connection manager created called ODS, and this connection manager used domain account before, now I have to switch it to user and password, the problem is that when I simple go to edit and change it doesn't work, but when I create new then it works. I saw that there are two icons near the connection manager, red arrow and fx , what does it mean ?
Edit:
OK I assume that fx means that it is parametrized and red arrow means problem with connection. Unfortunally there seems to be a bug, when connection manager is paramterized and there is connection string in parameter it doesn't work locally.
Cause:
Your connection manager goes offline when you make a change to the connection string that is incorrect, ex. spelling error in the server name, and the system can not validate the connection.
To fix it:
Correct the mistake in the connection string
Right click on the connection in the connection manager and un-select the "Work OffLine" option. This remove the "Red Arrow" icon and make your connection "live" again.
The red downward facing arrow indicates that the resource the connection manager is using is offline or unreachable in some fashion.
I believe you are stating that when you manually edit the connection manager, it doesn't work/persist and that is due to the Expression overriding the values. To resolve this, right click on your project level ODS Connection Manager and choose properties. Click the plus sign on the Expressions property and from there, you can identify the Variables and/or Parameters that are actually setting the values.
A Variable will take the form of #[Schema::VariableName]
A package level parameter will take the form of #[$Package::ParameterName]
A project level parameter will take the form of #[$Project::ParameterName]
Once you have identified the source of the Expression, then you will go to the Variables Pane (View -> Other Windows, Variables); Parameters tab at the top of the package; Projects.params and change the values there.
If all of that has the correct values, then you may be running into an incompatibility with your Project and packages' Protection Level. If it's DontSaveSensitive, clicking Save might result in the password being removed. I haven't worked with SQL Logins for some time so I don't know for sure how they will behave. You might be able to set the password, if it's a parameter, as Sensitive and see if that doesn't make it better. Might make it worse as there are strict rules about how you access a Sensitive parameter versus a non-sensitive.
Finally, the fx glyph signifies there is an expression somewhere on the connection manager. While it's likely on the ConnectionString or the individual components of database name, user and password, I've seen people use expressions on more esoteric properties.
the answer was to take connection manager ofline and connection manager worked for me in this format Data Source=xxx;User ID=xxx;Password=xxx;Initial Catalog=xxx;Provider=SQLNCLI11.1;Auto Translate=False;

SSIS parametrize connection strings

I am trying to set up deployment process for single package usinig project deployment so VS2012. I found that to change dynamicaly connection string on the server I can parametrize connections so I did this and created enviroments and I run my package with inviroment which has connnections strings as parameters and all seems to be fine, but why on connection manager I can still see some old setup made while developing? How can I remove it ?
By Parameterize, I assume you're using the Configuration section to globally configure a project/package or on a per-execution basis. This is in contrast to using project/package Parameters
I have created an SSIS Environment variable named ConnectionStrings in my deployment folder and it has two values: ServerName and CatalogName.
I right clicked on my project, DeployMe, and selected Configure. In your screenshot, you have clicked on the specific package and selected Configure. That or you manually changed the Scope drop down.
I first click on the References and add a pointer to my Environment
Back to the Parameters tab, I click over to Connection Managers and I'm going to configure the CM_Project connection manager's ServerName property to use my environment variable's ServerName value. Clear right?
After configuring the ServerName, I also configured the InitialCatalog property but instead of using my Environment Variable's value, I used the "Edit Value" option (above) to set it. The net result is that my properties now look like this.
The underscore indicates it's set from an environment variable
The bold text indicates it's set manually.
Now when I go to run my package, via Agent or manual execution, the first thing it's going to prompt me for is an environment reference. I've lost my bolding for the InitialCatalog but the underlining remains for ServerName property. None-the-less, both are different values and were I to execute it, they would pick up the correct values.
All that said, I find it far easier to just store the whole ConnectionString value. You will observe, if you take this route, that the values displayed for ServerName would show your design-time values but that's fine because the ConnectionString as a whole will override the individual values at run-time.
I know this is a generic answer but I'm hoping I've hit on what you're missing step-wise.

Create a shared datasource in VS2012 for SSRS

I'm just looking to create a shared datasource in VS2012 without selecting an entire database scheme. We'll mostly put doing all the dataset queries by sql query.
I found this but i'm still unable to create a shared datasource.
http://msdn.microsoft.com/en-us/library/ms159165.aspx
For an embedded data source, verify that Embedded connection is selected. Does not exists.
So how do you create a shared datasource in VS2012 with just a connection string?
A DataSource is just a connection string in an element in an xml structure as far as SSRS is concerned. A shared one is just one kept as it's own object and then the rdl elements(reports) have a reference in their xml to that object. Think of an rds file (data source for SSRS) as this very similar to .NET standard connection strings:
Data Source=(server);Initial Catalog=(database)
Plus you can store credentials to mock who is running the report. Thus you can make a proxy user to run the database connection. However SSRS does this through a GUI called 'Business Intelligence Development Studio' it is an add on to Visual Studio that is generally SQL Server version matches that VS version EXCEPT FOR 2012. That one creates a shell Visual Studio of VS 2010 just meant for BIDS.
To my knowledge you should be creating these directly in BIDS and not try to hack the RDS file directly unless you get the ReportService2010.asmx web service to mess with it's properties in .NET (which is a lot more work.).
To add one you just do this:
Go into BIDS with a report project
Expand a project
Right Click 'Shared Data Sources'> 'Add New'
Click 'Edit...' next to connection string
You get a menu very similar to ADO.NET standard connection string creator
Put in ServerName
Put in DatabaseName
8*** Optional put in default credentials.
Click OK
Generally SSRS has three parts to everything it does
Datasource = connection string (rds file when not embedded)
Dataset = select query or proc results or other data source return (rsd file when not embedded)
Report = resultant xml display of elements such as parameters, tables, matrices, etc. (RDL file when working on hosted report)
Generally reports can have everything embedded or else just reference everything they use. References are often easier for deployments sake as SSRS is designed to look if DataSources first exist and NOT OVERWRITE them by default. Thus if you reuse a datasource it is much easier in the long run as long as policy for it is set up correct.
If you want to just know the structure of an rds file they look like this:
<?xml version="1.0" encoding="utf-8"?>
<RptDataSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Test">
<ConnectionProperties>
<Extension>SQL</Extension>
<ConnectString>Data Source=TestServer;Initial Catalog=TestDatabase</ConnectString>
</ConnectionProperties>
<DataSourceID>45be0ac1-80a8-4d5c-906b-c13b03298e0a</DataSourceID>
</RptDataSource>

How can I dynamically set the location of an Execute Package Task in SSIS

I'm trying to set up a 'master' SSIS Package in SQL Server 2008 to run other 'child' packages. When developing the 'child' packages we have all the packages sitting on disk so we can easily debug them, so we use file connectors during development and can monitor the progress nicely.
When we deploy, we deploy the child packages to SSIS on SQL Server and then go through and change all the Execute Package Task's to use a location value of 'SQL Server' and set the PackageName. Once done, we deploy the 'master'.
What I'd like to do is use an Expression on the Execute Package Task to set the connection properties so we can configure this dependent on the environment. We have already setup a SQL Server configuration database using a view which checks the host name of the query and returns different values dependent on the query.
You have options. You're in the right frame of mind using expressions, but you might benefit from using configurations as well.
To use expressions, you would need to use a Script Task or Execute SQL Task to return back the list of files you want to work through.
You would either have to assign each returned value to it's own variable that is passed into the expression, or use a FOR EACH loop and work through a list, assigning the location of the child package each time.
The other option is to use configurations. My preference is to use a configuration table inside SSIS. If you have the same list of packages in each environment, you could either pass in the root directory and have an expression use that:
#[User::RootPackagePath] + "\PackageName.dtsx"
Or, you could simply have one record for each child package in the configuration table and that would be passed into the package.
Edit based on comments:
I was successfully able to configure a package to change via configurations to call a package from the file system then SQL.
I only needed to pass the Connection and PackageName for each. With SQL, it want a name from the connection manager (.\SQL2008R2 in my case) and the package name (\Package1). For the file system, PackageName is blanked out and the connection is a FileConnection in the connection manager.
You will have to keep both in the package, but you switch between the two.

textboxes in Datarepeater dynamically 'databound'

I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource. I am using VB.net. The database I am using is a MySQL database.
I have to use the connection dynamically due to the fact that the database my not permanently reside on the same server.
[edit]
ok, so it seams that I am a dolt when asking questions. The app that I am making is not web based. it is a simple (I hope) app that connects to a MySQL database, accesses a table so I can edit/view it. Current setup is using the Add DataSource wizard. I have successfully connected to the dbase dynamically using the mysql connector dll but without the textboxes set at design time to a datasource, I am unsure on how to 'link' them via the datarepeater.
Your connection string should be defined in your Web.Config, and if you move your database to a different server, it's just a matter of modifying the web.config entry. As long as you keep the connection string name the same, the BindingSource object will pick up the new value from the config.edit
In truth, the same concept should apply here as it does in the web app answer listed above.
All of your data objects should be hard-coded, and it's just the connection string (which you'll have to either ask the user for, or push out as update when the DB moves) which will get modified.
For example, create a App.Config file in your project. Have one of your configuration values be the connection string. This config value will be where you go to get the connection string whenever you need it. Then your wizard will be there to allow users to easily modify the connection.
then look in app.config
the conenction string should be there.
If it is not then you should put it in here as you can change this file at any time and not have to recompile your app.