If in fact you cannot create either a custom DLL or a custom SSIS component, your only alternative will be to use .NET reflection in your consuming scripts to find the appropriate methods/properties and access them dynamically.
That will be a significant amount of work, and the programming environment offered by SSIS isn't really conducive to it. If you really cannot deploy non-package code to your servers, I'd seriously rethink the architecture that needs that custom class.
EDIT: Simple access wasn't as hard as I thought it might be. Assuming you have a package-level variable of type Object
named "SomeObject", you could build a control flow like this:
The code for SCR_SetVariables is:
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_00e1230a50e6470e8324a14e9d36f6c7.csproj
{
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
#region VSTA generated code
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
class SomeClass
{
public string Greeting { get; set; }
public override string ToString()
{
return String.Format("My greeting is {0}", this.Greeting);
}
}
public void Main()
{
SomeClass myClass = new SomeClass();
myClass.Greeting = "Hello, world!";
Dts.Variables["SomeObject"].Value = myClass;
Dts.TaskResult = (int)ScriptResults.Success;
}
}
}
and the code for SCR_ShowVariables is:
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Reflection;
namespace ST_eea68a39bda44e9d9afaa07d2e48fc0f.csproj
{
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
#region VSTA generated code
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
public void Main()
{
object someObject = Dts.Variables["SomeObject"].Value;
PropertyInfo getGreeting = someObject.GetType().GetProperty("Greeting");
string greeting = (string)getGreeting.GetValue(someObject, null);
string msg = String.Format("someObject.Greeting = '{0}'", greeting);
System.Windows.Forms.MessageBox.Show(msg);
Dts.TaskResult = (int)ScriptResults.Success;
}
}
}
This will show the following messagebox: