none
Reading a SQL database inside a script task - SSIS 2012

    Question

  • Hi,

    I need to read a SQL Server db inside a script task in order to manage several reads from many tables by using an unique task. I think to use to achieve this goal with an OLE DB connection manager. Moreover, I think to use VB language to custom the task.

    So, I'm searching some articles ...

    Any helps, please? Thanks

    Friday, June 28, 2013 5:10 PM

All replies

  • Connecting to Data Sources in SSIS Script Task: http://msdn.microsoft.com/en-us/library/ms136018.aspx

    An OLEDB one is different by its conn string only

    ConnectionManager cm = Dts.Connections.Add("OLEDB");
    cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";

    Pay attention to the SQLNCL version e.g. 11 is needed to connect to SQL Server 2012


    Arthur My Blog

    • Proposed as answer by Subhash.Subramanyam Saturday, June 29, 2013 9:24 AM
    • Unproposed as answer by pscorca Sunday, June 30, 2013 8:56 PM
    Friday, June 28, 2013 7:55 PM
  • Hi ArthurZ,

    thanks for your reply, but I need to assume referring to an existing OLEDB connection manager by using the AcquireConnection method of Dts.Connections.

    The msdn sample is for an ADO.NET connection.

    Moreover, I'm interesting to know how doing a SQL query inside the script task.

    Thanks


    • Edited by pscorca Monday, July 01, 2013 9:06 AM adding
    Sunday, June 30, 2013 8:55 PM