March 2, 2009 at 9:54 pm
I am developing a package that can transfer data from Database A to B.
I B, that is the database I control, I have a table called customers, with customerNo and CustomerName.
I A, that I Don't control I have multi tables whit customerinformations. The name depends on the businessentity that the customers belongs to, meaning:
company1$customers
company2$customers
company3$customers
I only need data from one of these.
My question:
Any Idea on how I can make that happen, so that I can install the system at a new customer, and then just change a variable, so that the variable is company2$ or another name.
I have many tables, so the name should consist of a vairable (compnay1$ as an example)+fixed part (customer, items and so on)....
Søren,
MCITP SQL 2008 (administration / programming), MCITP SQL 2005 (BI), MCT
March 3, 2009 at 7:13 am
If I understand you correctly, you want the table name in a query to be dynamic based on the environment your package is installed in. Is that correct?
I would accomplish that by having a SSIS pacakge variable that contained the "customer" part of the table name (e.g. "customer1") and I would populate that variable from a package configuration.
Then, I would either build my query in a variable as an expression or in the OLEDB Source component as an expression:
"select * from " + User::CustPrefix + "$customers where..."
March 3, 2009 at 9:08 am
I think that is what I was looking for.
Thanks very much. I buy a beer if you ever come to Denmark 🙂
Søren
Søren,
MCITP SQL 2008 (administration / programming), MCITP SQL 2005 (BI), MCT
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply