locked
BIDS Package - do multiple script tasks in a package all share the same ScriptMain VB module RRS feed

  • Question

  • I have multiple Script tasks in a single package - talking SQL Server 2008 R2.

    If I edit a task I'm presented with the ssisscript editor which opens ScriptMain.vb - no problem.

    I make relevant code changes for my module and save ScriptMain.vb.

    I now want to do some coding for another Script task in the same package. The SSISSCRIPT editor presents a new shell called which is also called ScriptMain.VB but it doesn't show the code I entered in the first edit session.

    How do I execute different code subsets for the different Script Tasks?


    PaulTinNZ

    Monday, September 29, 2014 9:44 AM

Answers

  • When you edit the code of a script task with the Integration services script task editor window you can open the project explorer view with the menu View - Project explorer (you have no solution explorer). The project of the script task will have a name starting with st_... followed by a GUID string, suffixed by vbproj or csproj
    e.g. st_e57c34456f514942b17a9f7e9427a639.csproj

    project explorerEach script task will have its own unique project. All the modules like the ScriptMain.vb in this project are in this project scope only. The disadvantage is that you have no way to share common code by referencing modules from other script task projects in the same package. You can add references to the script but you will see that the Add references dialogue window shows no projects under the Projects tab.

    add references

    In short: all ScriptMain code is unique to the script task in which it belongs.


    Jan D'Hondt - SQL server BI development

    • Proposed as answer by Katherine Xiong Tuesday, September 30, 2014 6:36 AM
    • Marked as answer by paultinnz Tuesday, September 30, 2014 9:31 PM
    Monday, September 29, 2014 10:39 AM

All replies

  • Yes. They are different code snippets. Each have its own ScriptMain

    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    • Proposed as answer by Katherine Xiong Tuesday, September 30, 2014 6:36 AM
    Monday, September 29, 2014 10:06 AM
  • So does the scripteditor only show the VB code in the context of the selected Script Task? This is in a file in a TMP folder which then gets saved into the package.

    PaulTinNZ

    Monday, September 29, 2014 10:35 AM
  • Oh yes, do you have any reference material that I can read on how this works or is that just BIDS internals?

    PaulTinNZ

    Monday, September 29, 2014 10:36 AM
  • When you edit the code of a script task with the Integration services script task editor window you can open the project explorer view with the menu View - Project explorer (you have no solution explorer). The project of the script task will have a name starting with st_... followed by a GUID string, suffixed by vbproj or csproj
    e.g. st_e57c34456f514942b17a9f7e9427a639.csproj

    project explorerEach script task will have its own unique project. All the modules like the ScriptMain.vb in this project are in this project scope only. The disadvantage is that you have no way to share common code by referencing modules from other script task projects in the same package. You can add references to the script but you will see that the Add references dialogue window shows no projects under the Projects tab.

    add references

    In short: all ScriptMain code is unique to the script task in which it belongs.


    Jan D'Hondt - SQL server BI development

    • Proposed as answer by Katherine Xiong Tuesday, September 30, 2014 6:36 AM
    • Marked as answer by paultinnz Tuesday, September 30, 2014 9:31 PM
    Monday, September 29, 2014 10:39 AM