由于我今天偶然发现了这个问题,让我给你我的解决方案:
首先(您已经完成但为了清楚起见放在此处):
创建 ExecuteSQL 任务,将“ResultSet”设置为“Full result set”并将其分配给对象类型变量:


然后将其链接到“脚本任务”,然后将变量添加到“ReadOnly”或“ReadWriteVariables”

现在您只需要访问此变量 - 正如您建议的那样,将其填充到数据表中,然后将其分配给字符串变量:
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Data.OleDb;
public void Main()
{
// TODO: Add your code here
DataTable dt = new DataTable();
var oleDa = new OleDbDataAdapter();
oleDa.Fill(dt, Dts.Variables["Destination"].Value);
string yourValueAsString= dt.Rows[0][0].ToString();
Dts.Variables["MyStringVariable"].Value = yourValueAsString;
[...]
Dts.TaskResult = (int)ScriptResults.Success;
}