【发布时间】:2014-04-10 03:48:34
【问题描述】:
我正在尝试使用 scriptcomponent SSIS 在 C# 中将 dt_text (blob) 转换为 dt_str varchar(max),我不能使用数据转换转换,因为它将字符限制为 8000 个字符,我在文本字段中有重要信息超过10000 个字符(大量笔记信息)。
我从网上发布的示例开始
using System;
using System.Data;
using System.Text.RegularExpressions; // Added
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
// Method that will be executed for each row.
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
if (!Row.Description_IsNull)
{
cont.description =
System.Text.Encoding.Unicode.GetString(
Row.Description.GetBlobData(
0, Convert.ToInt32(Row.Description.Length)));
}
}
在构建时,我收到以下错误消息,不确定我在这里缺少什么。我是 C# 代码的新手.. (错误 2“字符串”不包含“GetBlobData”的定义,并且找不到接受“字符串”类型的第一个参数的扩展方法“GetBlobData”(您是否缺少 using 指令或程序集引用?) )
提前致谢
【问题讨论】: