对于Text,nText等类型一般是用指针对其操作的.看一下TEXTPTR, READTEXT,WRITETEXT等
操作.另外也可以用TEXTSIZE等设置取得TEXTSIZE大小的nText记录等.
-----------------------------------------------------------------
TEXTPTR (T-SQL)
Returns the text-pointer value that corresponds to a text, ntext,
or image column in varbinary format. The text pointer is checked
to ensure that it points to the first text page.
The retrieved text pointer value can be used in
READTEXT, WRITETEXT, and UPDATE statements.
--------------------------------------------------------------------
例子:
B. Return text data
This example selects the pub_id column and the 16-byte text pointer of the pr_info column from the pub_info table.
USE pubs
GO
SELECT pub_id, TEXTPTR(pr_info)
FROM pub_info
ORDER BY pub_id
GO
Here is the result set:
pub_id
------ ----------------------------------
0736 0x6c0000000000feffb801000001000100
0877 0x6d0000000000feffb801000001000300
1389 0x6e0000000000feffb801000001000500
1622 0x700000000000feffb801000001000900
1756 0x710000000000feffb801000001000b00
9901 0x720000000000feffb801000001000d00
9952 0x6f0000000000feffb801000001000700
9999 0x730000000000feffb801000001000f00
(8 row(s) affected)
This example shows how to return the first 8,000 bytes of text without
using TEXTPTR.
USE pubs
GO
SET TEXTSIZE 8000
SELECT pub_id, pr_info
FROM pub_info
ORDER BY pub_id
GO
Here is the result set:
pub_id pr_info
------ -----------------------------------------------------------------
0736 New Moon Books (NMB) has just released another top ten publication. With the latest publication this makes NMB the hottest new publisher of the year!
0877 This is sample text data for Binnet & Hardley, publisher 0877 in the pubs database. Binnet & Hardley is located in Washington, D.C.
This is sample text data for Binnet & Hardley, publisher 0877 in the pubs database. Binnet & Hardley is located in Washi
1389 This is sample text data for Algodata Infosystems, publisher 1389 in the pubs database. Algodata Infosystems is located in Berkeley, California.
9999 This is sample text data for Lucerne Publishing, publisher 9999 in the pubs database. Lucerne publishing is located in Paris, France.
This is sample text data for Lucerne Publishing, publisher 9999 in the pubs database. Lucerne publishing is located in
(8 row(s) affected)