Showing posts with label external. Show all posts
Showing posts with label external. Show all posts

Thursday, March 8, 2012

DataFlow Task & Filters

Hi,

I am getting data from an external source. External data has a column called "Type". I have a variable in my package which contains the list of types as shown below:

Filtered_type_List = 2,4,8,10,11

If this variable(Filtered_type_List) is blank, then I need all the data from the external source and if it is not blank then I only need the records matching to his list. How can I implement this in DataFlow Task?

Thanks

You could do this in an expression. Something like:

"SELECT * FROM MyTable " + (LEN(MySSISVariable) != 0 ? "WHERE MyColumn IN (" + MySSISVariable + ")" : "" )

That expression will (I think) add a WHERE clause if the length of the string inside the variable (which I have called MySSISVariable) is not zero.

HTH

-Jamie

|||

Hi Jamie,

Where should I put this "Select" statement,

1. Source using SQL Command as variable using OLE DB Source or

2. Lookup transformation

Thanks

|||

OLE DB Source. Set it to 'SQL Command from variable' and paste the expression that I provided above into the variable expression. The variable will require EvaluateAsExpression=TRUE.

-Jamie

Tuesday, February 14, 2012

Database upload

I want to upload my DB created with WebMatrix to an external SQL-server. Is that possible with MSDE or WebMatrix??To upload your database you have to do the following things:

1st. Create the database on the destination sql server (you can create an sql script for that, if you have Enterprise Manager)

2nd. Either use a custom SQL script or Enterprise Manager to upload your data.

Enterprise manager comes with SQL Server, not with MSDE.|||You can also use DTS, since MSDE includes the command-line tool.

Don