Search code examples
sql-serverssisetlsql-server-data-toolscommand-timeout

Change CommandTimeout of SSIS OleDB Source programmatically?


in a quite big project we recently received the request to execute certain SSIS packages during regular business hours. However, while the package can take as long as it needs during the night, during working hours it is most important to stop execution as soon as the source query exceeds a given time.

I am aware, that there is a property of the OleDB source which can be set, but is there any way to set it programmatically / via expression? There should be a way to parametrize this timeout, no?

Thanks for any help.


Solution

  • You cannot do it with Expressions – see Microsoft Doc for available properties for a Data Flow. None of OLE DB Source properties is exposed as expression.

    You can create another package with fixed OLEDB Source timeouts, and start it when needed. If you really want to parametrize it, you can generate package with BIML providing needed value at generation time; but you do not have a flexibility to change it at runtime.