Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Pass Variable in SSIS package

Author  Topic 

SQLConfusesMe
Starting Member

4 Posts

Posted - 2014-10-07 : 04:05:29
Hi All,

I'm trying to pass a variable within an SSIS package from a variable and OLE DB Source task. I've defined an SSIS variable, Name = Murt, and in the OLE DB Source task I enter a SQL Command as the source. In this SQL code in the WHERE condition is the place I want to pass the variable. So I know to use a '?' in the place where I want the variable, i.e.
SELECT *
FROM Table1
WHERE Name = ?

However, I want to use LIKE in the SQL code, e.g.
SELECT *
FROM Table1
WHERE Name LIKE '%Murt%'
So I can find all Names that have the string 'murt' in them. But I can't get this working. I've tried,
SELECT *
FROM Table1
WHERE Name LIKE '%?%'
but this doesn't work.

Any help is greatly appreciated.

Thanks in advance :)
   

- Advertisement -