SSIS/SSRS-The 由 VariableName 属性 指定的变量 "MyNameSpace::MyVariableName" 不是有效变量
SSIS/SSRS-The variable "MyNameSpace::MyVariableName" specified by VariableName property is not a valid variable
环境:SQL服务器 2008 R2
我在 SQL Server 2008 R2 上的计划作业 运行 中不断收到此错误:
Error: Code: 0xC02020EE Source: Data Flow Task - Fix Missing this and that Row Count - This Not Fixed [148] Description: The variable "MyNameSpace::MyVariableName" specified by VariableName property is not a valid variable. Need a valid variable name to write to. End Error
我看不出哪里出了问题。变量在 dtsx 中声明如下:
<DTS:Variable>
<DTS:Property DTS:Name="Expression"/>
<DTS:Property DTS:Name="EvaluateAsExpression">0</DTS:Property>
<DTS:Property DTS:Name="NameSpace">MyNameSpace</DTS:Property>
<DTS:Property DTS:Name="ReadOnly">0</DTS:Property>
<DTS:Property DTS:Name="RaiseChangedEvent">-1</DTS:Property>
<DTS:Property DTS:Name="IncludeInDebugDump">6789</DTS:Property>
<DTS:VariableValue DTS:DataType="3">0</DTS:VariableValue>
<DTS:Property DTS:Name="ObjectName">MyVariableName</DTS:Property>
<DTS:Property DTS:Name="DTSID">{F6C30C52-3BDA-45D6-862B-10405215FABC}</DTS:Property>
<DTS:Property DTS:Name="Description"/>
<DTS:Property DTS:Name="CreationName"/>
</DTS:Variable>
它被这样使用:
<component id="148" name="Row Count - IDs Not Fixed" componentClassID="{150E6007-7C6A-4CC3-8FF3-FC73783A972E}" description="Counts the rows in a dataset." localeId="-1" usesDispositions="false" validateExternalMetadata="True" version="0" pipelineVersion="0" contactInfo="Row Count;Microsoft Corporation; Microsoft SqlServer v10; (C) Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;0">
<properties>
<property id="149" name="VariableName" dataType="System.String" state="default" isArray="false" description="Specifies the variable to hold the row count." typeConverter="" UITypeEditor="" containsID="false" expressionType="None">MyNameSpace::MyVariableName</property>
</properties>
<inputs>
<input id="150" name="Row Count Input 1" description="" hasSideEffects="true" dangling="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed">
<externalMetadataColumns isUsed="False"/>
</input>
</inputs>
<outputs>
<output id="151" name="Row Count Output 1" description="" exclusionGroup="0" synchronousInputId="150" deleteOutputOnPathDetached="false" hasSideEffects="false" dangling="false" isErrorOut="false" isSorted="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed">
<externalMetadataColumns isUsed="False"/>
</output>
</outputs>
</component>
有人可以帮助我了解需要更正哪些内容才能避免此错误吗?谷歌搜索这个错误到目前为止没有帮助。
您的问题与命名空间“MyNameSpace”有关。根据在线书籍,只允许使用以下两个名称空间:
命名空间
Integration Services 提供两个命名空间,User 和 System。默认情况下,自定义变量位于 User 命名空间中,系统变量位于 System 命名空间中。您可以为用户定义的变量创建额外的命名空间并更改User命名空间的名称,但您不能更改System命名空间的名称、将变量添加到System命名空间或将系统变量分配到不同的命名空间。
环境:SQL服务器 2008 R2
我在 SQL Server 2008 R2 上的计划作业 运行 中不断收到此错误:
Error: Code: 0xC02020EE Source: Data Flow Task - Fix Missing this and that Row Count - This Not Fixed [148] Description: The variable "MyNameSpace::MyVariableName" specified by VariableName property is not a valid variable. Need a valid variable name to write to. End Error
我看不出哪里出了问题。变量在 dtsx 中声明如下:
<DTS:Variable>
<DTS:Property DTS:Name="Expression"/>
<DTS:Property DTS:Name="EvaluateAsExpression">0</DTS:Property>
<DTS:Property DTS:Name="NameSpace">MyNameSpace</DTS:Property>
<DTS:Property DTS:Name="ReadOnly">0</DTS:Property>
<DTS:Property DTS:Name="RaiseChangedEvent">-1</DTS:Property>
<DTS:Property DTS:Name="IncludeInDebugDump">6789</DTS:Property>
<DTS:VariableValue DTS:DataType="3">0</DTS:VariableValue>
<DTS:Property DTS:Name="ObjectName">MyVariableName</DTS:Property>
<DTS:Property DTS:Name="DTSID">{F6C30C52-3BDA-45D6-862B-10405215FABC}</DTS:Property>
<DTS:Property DTS:Name="Description"/>
<DTS:Property DTS:Name="CreationName"/>
</DTS:Variable>
它被这样使用:
<component id="148" name="Row Count - IDs Not Fixed" componentClassID="{150E6007-7C6A-4CC3-8FF3-FC73783A972E}" description="Counts the rows in a dataset." localeId="-1" usesDispositions="false" validateExternalMetadata="True" version="0" pipelineVersion="0" contactInfo="Row Count;Microsoft Corporation; Microsoft SqlServer v10; (C) Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;0">
<properties>
<property id="149" name="VariableName" dataType="System.String" state="default" isArray="false" description="Specifies the variable to hold the row count." typeConverter="" UITypeEditor="" containsID="false" expressionType="None">MyNameSpace::MyVariableName</property>
</properties>
<inputs>
<input id="150" name="Row Count Input 1" description="" hasSideEffects="true" dangling="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed">
<externalMetadataColumns isUsed="False"/>
</input>
</inputs>
<outputs>
<output id="151" name="Row Count Output 1" description="" exclusionGroup="0" synchronousInputId="150" deleteOutputOnPathDetached="false" hasSideEffects="false" dangling="false" isErrorOut="false" isSorted="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed">
<externalMetadataColumns isUsed="False"/>
</output>
</outputs>
</component>
有人可以帮助我了解需要更正哪些内容才能避免此错误吗?谷歌搜索这个错误到目前为止没有帮助。
您的问题与命名空间“MyNameSpace”有关。根据在线书籍,只允许使用以下两个名称空间:
命名空间
Integration Services 提供两个命名空间,User 和 System。默认情况下,自定义变量位于 User 命名空间中,系统变量位于 System 命名空间中。您可以为用户定义的变量创建额外的命名空间并更改User命名空间的名称,但您不能更改System命名空间的名称、将变量添加到System命名空间或将系统变量分配到不同的命名空间。