none
"COMMAND TEXT WAS NOT SET FOR THE COMMAND OBJECT."

    Question

  • In SSIS, In OLEDB Source, I have the SQL statement in a string variable lets say in strSQL.

     

    When I simply putting this  @[User::strSQL]  in expression builder and calling this variable in OLEDB source it is throwing me an error

    "COMMAND TEXT WAS NOT SET FOR THE COMMAND OBJECT."

     

    Please help

     

    Tuesday, April 27, 2010 12:52 AM

Answers

  • What is the data access mode inside OLEDB Source? It should be SQL Command From variable. Aftter this, select the variable from drop down box.


    Nitesh Rai- Please mark the post as answered if it answers your question
    • Proposed as answer by ETL vs ELTL Tuesday, April 27, 2010 5:40 AM
    • Marked as answer by Zongqing Li Monday, May 03, 2010 7:38 AM
    Tuesday, April 27, 2010 12:59 AM

All replies

  • What is the data access mode inside OLEDB Source? It should be SQL Command From variable. Aftter this, select the variable from drop down box.


    Nitesh Rai- Please mark the post as answered if it answers your question
    • Proposed as answer by ETL vs ELTL Tuesday, April 27, 2010 5:40 AM
    • Marked as answer by Zongqing Li Monday, May 03, 2010 7:38 AM
    Tuesday, April 27, 2010 12:59 AM
  • I guess you are creating an "Expression" to assign the SQL script to your OLEDB Source component. Simply double click on the OLEDB Source, on the window that opens up set the "Data Access Mode" dropdown selection to "SQL commmand from variable" and then select the variable from "Variable Name" dropdown.

    Ensure that the SQL script held in the variable is a valid one. This should resolve your problem.

    Hope this helps.

     

    Cheers!!

    Muqadder. 

    Tuesday, April 27, 2010 5:32 AM
  • u have to take the oledb source and in drop down list u have to specify the sql command from variable...

    and the variable shold be of string as ur writing the querry in that..

    then map that string variable in the drop down of variable..

    and sql command from variable doesnt take object variables...

    so change the datatype of the variable..

    or else another thing that can be done here is.. take a execute sql task and go to the expression and assign the sqlstatement source to that variable that has the querry.,. and depending upon ur querry output create var and map that to the variable...


    Priyanka.Sutrave
    Tuesday, April 27, 2010 5:54 AM