Question : Error running parameterized query against MySQL database in SSIS package

I am building a SQL 2005 SSIS package to accomplish a task that was previously done in SQL 2008 without any problems. The first control flow step connects to a SQL 2008 database and retrieves and stores an data in variables. That part isn't a problem. The second step connects to a MySQL database and runs a query using the varaibles as input parameters. At this Point I get the error:

'INSERT INTO test (TestID) VALUES (?test)': 'Only MySqlParameter objects may be stored'

I try both with @ or ?. An also  the "Allow user parameters" and "Use old syntax" in the my sql connection settings. Nothing helps.

If I try it with
'INSERT INTO test (TestID) VALUES (1) it works also fine. Only with parameters it fails.

On my SQL 2008 SSIS packets it works fine. I use my sql ado.net connector 6.1.3 on both SQL 2005 and SQL 2008.

ANyone an idea?

Thans a lot.

Answer : Error running parameterized query against MySQL database in SSIS package

now i checked whole work with mysql ODBC connector instead of ado.net connector
that work correctly with SSIS 2005.
first download it from :
http://dev.mysql.com/downloads/connector/odbc/5.1.html

then install it.
after installation try to create a ODBC connection to mysql as below in attachement images
remember you need to use this connection string:
DRIVER={MySQL ODBC 5.1 Driver};SERVER=;DATABASE=mydb;UID=root

you can see how to set it in first image

then try again


 
ODBC mysql
ODBC mysql
 
 
set parameters for odbc with ?
set parameters for odbc with ?
 
 
map parameters
map parameters
 
Random Solutions  
 
programming4us programming4us