Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Trying to access ReadWrite and ReadOnly variables in Script Component's ProcessInputRow

Trying to access ReadWrite and ReadOnly variables in Script Component's ProcessInputRow

Scheduled Pinned Locked Moved Database
helpsql-serversecuritydebuggingtools
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi All, I am trying to access PackageLevel variables inside my Script Components ProcessInputRow event of my SSIS package, but Its giving me following error

    An exception of type 'Microsoft.SqlServer.Dts.Pipeline.ReadWriteVariablesNotAvailableException' occurred in Microsoft.SqlServer.TxScript.dll but was not handled in user code

    Additional information: The collection of variables locked for read and write access is not available outside of PostExecute.

    And my code is as below.

    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
    IDTSVariables100 vars = null;
    VariableDispenser.LockForRead("System::TaskName");
    VariableDispenser.GetVariables(out vars);
    string TaskName = vars["System::TaskName"].Value.ToString();
    vars.Unlock();

        var watcherDBConnectionString
     = "Data Source=" + Variables.TargetServer01.ToString() + ";Initial Catalog=" + Variables.WatcherDB.ToString() + ";" + Variables.Security.ToString();
    
        var ErrorLogStoredProcedure = ReadOnlyVariables\["ErrorLogStoredProcedure"\].Value.ToString();
    
        int PriorityToBeLogged = (int)Priority.Debug;
    
        Log(Variables.PackageName.ToString(), "", "", "ScriptMain", "Main", "Row.FileName : " + Row.FileName
                                + ", Row.File.Length : " + Row.File.Length.ToString(), "ABDUL"
                                    , Priority.LogicalError, PriorityToBeLogged, watcherDBConnectionString.ToString(), ErrorLogStoredProcedure.ToString());
    }
    

    Can anybody please help me in this? Any code snippet, a link or even a suggestion would help, can't I access or assign the Variables in the ProcessInputRow event of Script Component?

    Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups