好像现在 SQL 还不支持,包括 text 字段,我也不清楚关注up

解决方案 »

  1.   

    我也有类似问题,对于text,ntext和image, T-SQL可以使用readtext,writetext,updatetext等系统函数操作,但关键是无法使用存储过程的参数传递(但是参数允许上述类型)。所以解决的办法是使用oledb来做。例如,asp.net中不使用system.data.sqlclient,而使用System.Data.OleDb
      

  2.   

    有两个 text、ntext 和 image 函数专门用于对 text、ntext 和 image 数据所进行的操作: TEXTPTR 返回 binary(16) 对象,该对象包含指向 text、ntext 或 image 实例的指针。指针一直有效,直到删除该行。
    TEXTVALID 函数用来检查指定的文本指针是否有效。 
    文本指针被传递到用于操作 text、ntext 和 image 数据的 READTEXT、UPDATETEXT、WRITETEXT、PATINDEX、DATALENGTH 和 SET TEXTSIZE Transact-SQL 语句。在 Transact-SQL 语句中,总是使用数据的指针或地址来引用 text、ntext 和 image 数据。下例使用 TEXTPTR 函数来查找与 pubs 数据库的 pub_info 表中 pub_id 0736 相关联的 text 列 (pr_info)。下例首先声明一个局部变量 @val。然后将文本指针(长二进制字符串)置于 @val 中,并将其作为参数提供给 READTEXT 语句,该语句将返回从第五个字节(偏移量为 4)开始的 10 个字节。USE pubs
    DECLARE @val varbinary(16)
    SELECT @val = textptr(pr_info) FROM pub_info
    WHERE pub_id = '0736'
    READTEXT pub_info.pr_info @val 4 10下面是结果集:(1 row(s) affected)pr_info
    ----------------------------------------
     is sample支持使用 CAST 函数进行从 text 到 varchar、从 ntext 到 nvarchar 和从 image 到 varbinary 或 binary 的显式转换,但 text 或 image 数据将截断为 8,000 个字节,ntext 数据将截断为 4,000 个字符(8,000 个字节)。不支持从 text、ntext 或 image 到其它数据类型的转换(无论是显式的还是隐性的)。但是,可以进行 text、ntext 或 image 数据的间接转换,例如: CAST( CAST( text_column_name AS VARCHAR(10) ) AS INT )。
      

  3.   

    it will not be possible to save the image content through a stored procedure1. you need to use ADO AppendChunk method, I am sure you can find plenty of examples by searching for "AppendChunk" on cn.yahoo.com2. if you know the image is in a file locally on the server, you can use "TextCopy" example which came with SQL Server installation, here is an example:
    http://groups.google.com/groups?selm=3d40792f%40news.softvelocity.com&oe=UTF-8&output=gplain