Global find replace in SSIS 2008 and 2012 - ssis

I have several hundred SSIS pkgs, and I need to change one of the connection mangers per package from a SQL Server connection to another DB platform (ODBC). I found this link and think I can make it work. But I wondered if it was possible to use a tool like notepad++ or the like to open all of them at the same time and do a global find/replace with the connection manager. This would also need to be done to translate all the TSQL to the new DB platform SQL.

Related

From Access to SQL Server 2008

I am struggling a bit with the following. Our forecasting tool generates some 100k of records of forecast information in Access each month. The tool is an Excel - Access combination. I want to upload the data from Access to SQL Server after the forecast is done (for multiple purposes). I tried to look up the most easy way but not sure what to use. ADO seems handy where I could integrate that in an existing macro that cleans up the database. Anybody done this before and has some snippet of code to use?
We use SQL Server Management Studio 2008, but not sure whether that's relevant here.
Thanks in advance,
Michiel
In Access, link via ODBC the tables in SQL Server you wish to upload to.
Then create and run append queries to insert the data in the linked tables.
I suggest using SSIS package which is started by job on sql server side (by shedule or manual). You can create package with the help of sql server import/export wizard. I think this is the best way to import data from access to sql server.
Thanks for the answers. I will try to do the linked table way, but I already had a look to that and it seems that due to the fact that I use citrix server I was not able to link it directly to SQL server via ODBC. So I have to check what's different there. Not familiar with the SSIS package yet but I will definitely look into that if the first option does not seem to work out.
Thanks again guys

Data in SQL Server 2008 Express edition does not show up after insert?

I have a SQL Server 2008 Express edition database and I am inserting data to it via a windows application, using Linq-to-SQL. I know the data exists in database because when I query the database I get some data but in SQL Server Management Studio when I right click on a table and click even : 'Edit top 200 rows' or 'Select top 1000 rows' I can not view any data ! any helps ?
Assuming you're using the User Instance and AttachDbFileName= approach - I would argue this approach is severely flawed. Visual Studio will be copying around the .mdf file and most likely, your INSERT works just fine - but you're just looking at the wrong .mdf file in the end!
If you want to stick with this approach, then try putting a breakpoint on the myConnection.Close() call - and then inspect the .mdf file with SQL Server Mgmt Studio Express - I'm almost certain your data is there.
The real solution in my opinion would be to
install SQL Server Express (and you've already done that anyway)
install SQL Server Management Studio Express
create your database in SSMS Express, give it a logical name (e.g. VictoryDatabase)
connect to it using its logical database name (given when you create it on the server) - and don't mess around with physical database files and user instances. In that case, your connection string would be something like:
Data Source=.\\SQLEXPRESS;Database=VictoryDatabase;Integrated Security=True
and everything else is exactly the same as before...
I believe LinqToSql has a "Save" command that actually writes the data to the database. Until that happens you are merely holding it in memory.
ETA: see this question and its answers

SSIS migration from 2005 to 2008? Just opening in BIDS 2008 (which will do conversions) and then deploying in 2008 enviorment work?

I have been given a task to migrate 2005 packages to 2008, I was looking for discontinued features by SSIS 2008 on http://technet.microsoft.com/en-us/library/bb500429(v=sql.100).aspx
It seems VSA is discontinued and replace by VSTA. As I am doing such work first time I just wanted to check opening packages BIDS 2008 and then deploying them in 2008 enviorment will do or I will need to some other stuff also?
To me, the VSA -> VSTA change you just mentioned simply means that now we can code in C# :D
Overall, to migrate you just need to opne the package on BIDS 2008, but there are a few things you need to take care yourself. What it comes to my mind for example is the behavior of lookup tasks have changed a little (the way no match rows are treated) and the order variables are loaded from config files changed too. I mean, just by running and debugig your pakcages you should be able to test these kind of things
The migration is done very well by just opening the package, even the code change.
A couple gotchas are:
1. If you have ConnectionString in your config, you have to change Provider from SQLNCLI.1 to
Provider=SQLNCLI10.1; (or add the old provider to your new SSIS 2008 production server.
2. I have a case where a space gets in there and gives me an error. I fix in Connection connectionString property by removing the space. It is hard to see in BIDS. Provider= SQLNCLI10.1;

How to parameterize database connection string in an SSIS package?

I have a SSIS package built in Business Intellegience Development Studio which have both source and destination database specified. Now I want to use some variables to parameterize the database connections and run the package in a command line.
I try to replace the database name and sql server instance with my variable #[User::SourceDb]. #[User::SourceHost], but it failed to connect to the database.
Is that possible to paramterize the database and is there anything wrong with my variable useage? Thanks in advance!
There is a nice post here that details one way of doing this.
You will need to use a ConnectionManager and set the ConnectionString property of that from a Configuration Package.
The ConnectionString property is a fully qualified database connection string, like
Data Source=localhost;Initial Catalog=SSISConfig;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;
There are a few gotchas and annoyances with using configuration packages so you may have to fiddle around a bit. I'd be more detailed but it has been about a year since I last worked on an SSIS project.
If you have any specific problems, please come back and comment about what you've hit. I'll try and refire the old memories.
You need to define "expressions" in the connection manager which then substitute into server/database.
You can't use variables directly quite often in SSIS
See "Using Variables in Packages" whcih links to Using Property Expressions in Packages.
And after a quick Bingle: http://sqlrs.blogspot.com/2006/03/using-expression-variables-in-ssis.html
You can right-click on any connection on the project or package and "Parameterize" all the fields from connection, in project or in package parameters. Connection string differs for OLE DB connection to .NET Providers(SqlClient Data Provider) type, so be careful. We have manage to have one centralized place for connection in Project.params

Deploying a project using LINQ to SQL

I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005.
The database has the same name, and all tables are identical but the hostname is different.
The only way I have found to make my app work from one machine to the next is to re-open the code in Visual Studio, delete all of the objects referring to the SQL express instance from my .mdbl, save the project, connect to the other server, drag all of the references back on, and rebuild the application for release once more.
an answer here suggested that one can simply modify the app.config/web.config file - whih would work for asp.net, but this is a winforms application. What's the correct way of making LINQ to SQL apps use a new database without having to re-open the app in visual studio?
If I understand your problem correctly, you simply change the database's connection string in your app.config / web.config.
Edit, post clarification: You have the connection strings stored somewhere. They might be in the app.config of your server. Still, you get them from somewhere and that somewhere may be in an app.config. Use that then :)
One good solution is to add another connection to the dbml file itself. You can get to this by right-clicking on the field of the design surface and selecting properties. From there, you can add another connection string. Instead of deleting everything and redragging, just change the string and recompile.
But if you want to get fancy-schmancy, you can have the program auto-detect whether it is being run locally or not, using this neat utility function: detect local
And go from there to set the appropriate connection string based on the results.
A more useful answer...
app.config ends up as appname.exe.config when it has been built.
rather than opening Visual Studio and modifying app.config, you can simply edit the appname.exe.config file, and restart the app.
I believe you can store the connection information in an app.config file and retrieve it from there. Here is a post about doing that with LINQ to SQL. Once you deploy it to a production server, you can just edit the XML to change the data source.