ssis 脚本任务中的字符数据中不允许使用 ']]>'
']]>' is not allowed in character data within ssis script task
我在 VS 2012 Integrated shell (SSDT-BI development)
中使用了一个 SSIS Script task
,但我 运行 遇到了一个奇怪的错误。
基本上,当我关闭 Script Task editor
时,我的代码一直在 VS 崩溃。它提示我错误:
"Failure saving package. ']]>' is not allowed in character data.
(Microsoft.SqlServer.ManagedDTS).
也是给我的:
"Cannot show the editor for this task. Exception from HRESULT:
0x80131940 (Microsoft.SqlServerDTSRuntimeWrap)."
然后 VS 将崩溃并自行重启。
所以从错误来看,它似乎没有 link string
我传递给一个变量,我能够使用下面的代码验证它(它触发了确切的同样的错误)。
我在这里遗漏了什么...这是一个错误吗?我确信我只是公然遗漏了一份白皮书或关于这个主题的东西,但为什么下面的代码不能在 SSIS 脚本任务中工作?我知道它适用于 C# 控制台应用程序。
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
// TODO: Add your code here
string hi = "<![CDATA[" + "]]>";
Dts.TaskResult = (int)ScriptResults.Success;
}
#region ScriptResults declaration
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
}
您不能使用 ]]>
或 <
,因为脚本代码本身在您的包中保存为 XML。
string hi = (char)60+"![CDATA[" + "]]"+ (char)62;
我在 VS 2012 Integrated shell (SSDT-BI development)
中使用了一个 SSIS Script task
,但我 运行 遇到了一个奇怪的错误。
基本上,当我关闭 Script Task editor
时,我的代码一直在 VS 崩溃。它提示我错误:
"Failure saving package. ']]>' is not allowed in character data. (Microsoft.SqlServer.ManagedDTS).
也是给我的:
"Cannot show the editor for this task. Exception from HRESULT: 0x80131940 (Microsoft.SqlServerDTSRuntimeWrap)."
然后 VS 将崩溃并自行重启。
所以从错误来看,它似乎没有 link string
我传递给一个变量,我能够使用下面的代码验证它(它触发了确切的同样的错误)。
我在这里遗漏了什么...这是一个错误吗?我确信我只是公然遗漏了一份白皮书或关于这个主题的东西,但为什么下面的代码不能在 SSIS 脚本任务中工作?我知道它适用于 C# 控制台应用程序。
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
// TODO: Add your code here
string hi = "<![CDATA[" + "]]>";
Dts.TaskResult = (int)ScriptResults.Success;
}
#region ScriptResults declaration
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
}
您不能使用 ]]>
或 <
,因为脚本代码本身在您的包中保存为 XML。
string hi = (char)60+"![CDATA[" + "]]"+ (char)62;