|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 20, 2010 10:56 AM
Points: 4,
Visits: 12
|
|
Hello,
I created a Dts package to copy one or both of the tables in an Access database to a Sql server database. I created the connections, created global parameters, and in the Transform data Task properties, I chose "SQL query" and wrote this
IF ? = 1 -- gvTable1Flag (unsigned int) SELECT * INTO ? FROM Access_Table1 -- gvNewTableName1 (string)
IF ? = 1 -- gvTable2Flag (unsigned int) SELECT * INTO ? FROM Access_Table2 -- gvNewTableName2 (string)
Basically, I want to be able to choose which Access tables to copy to the Sql server database and have the source tables copied to destination tables whose names are not constant.
I am getting an error "Invalid Sql statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE'"
If I remove the If statements, I get the following error
"The SELECT statement includes a reserved word or an argument name, that is misspelled, or the punctuation is incorrect."
How can I get this to work?
Thank you,
Burak
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, November 02, 2010 8:28 PM
Points: 73,
Visits: 180
|
|
Hi Burak30,
you cant do that in the way as you are trying..
I guess you are writing the SQL query in Execute SQL task, this task works on Single connection, where as your query has two connections, source (Access) and destination(SQL Server, i.e ?). use DF task , you will get it.
Regards RB
|
|
|
|