Link to home
Start Free TrialLog in
Avatar of onesegun
onesegunFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SSIS. Execute SQL Task Parameter Mapping

Hi there,

I have this SQL query in the SQL Execute Task Editor:

INSERT INTO [aging].[dbo].[ag_ageddebtor]
SELECT * FROM [aging].[dbo].[ag_ageddebtor_staging]
WHERE [Co Code] IN (?)

Open in new window

.

In the parameter mapping I have the following user defined variable: 'User::CompanyCode' that has the following values ('8560',4956','5863','6245') and it is a string data type.

I have set the parameter mapping as follows for this variable:
1. Direction: Input
2. Data Type: VARCHAR
3. Parameter Name: 0
4. Parameter Size: -1

The SQL does not execute as expected i.e. returns 0 records.

However, if I put query in the SQL Execute task it works:

INSERT INTO [aging].[dbo].[ag_ageddebtor]
SELECT * FROM [aging].[dbo].[ag_ageddebtor_staging]
WHERE [Co Code] IN ('8560',4956','5863','6245')

Open in new window

.

What I'm I doing wrong?

Thanks

OS
Avatar of Phillip Burton
Phillip Burton

You said:

In the parameter mapping I have the following user defined variable: 'User::CompanyCode' that has the following values ('8560',4956','5863','6245') and it is a string data type.

Does User::CompanyCode have ('8560',4956','5863','6245') or '8560',4956','5863','6245' - i.e. are the brackets included?
Avatar of onesegun

ASKER

No the brackets are not included.....
ASKER CERTIFIED SOLUTION
Avatar of Phillip Burton
Phillip Burton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial