Monday, July 27, 2015

Dynamic SQL Command in ADO NET Source


In ADO NET Source there is no place to insert dynamic SQL command. (OLEDB Source there is SQL command from variableto insert dynamic SQL command).
As shows in following figure there are only two options in ADO NET Source.




What you have to do is just go back to control flow and check the properties of Data Flow task that consist ADO NET Source.

Once you get the Expression Editor window you can set the [your ADO NET Source Name][SQL Command] as you want.








You can set a dynamic SQL command to a variable in earlier step. Then use that variable in Expression builder as shown below.