如何用SQL语句对ntext字段操作(200分)

  • 主题发起人 主题发起人 HeBaisong
  • 开始时间 开始时间
H

HeBaisong

Unregistered / Unconfirmed
GUEST, unregistred user!
我的一个Table中有一个字段,他是ntext类型的,由于数据内容很多,我该如何对他进行
插入、更新、删除、选取的动作
我在insert 、update、select的时候不能将我所有的数据插入、选择出来,应该怎么办?
例如我select Details from ordertable的时候,不能出现我这个字段的所有内容
 
什么数据库?
 
SQL Server 7.0
 
ntext字段是大对象字段,你要是用MEMO等控件显示它,选择是可以得到的,但你的
显示可能有问题。
 
对于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)





 
接受答案了.
 

Similar threads

回复
0
查看
999
不得闲
S
回复
0
查看
855
SUNSTONE的Delphi笔记
S
S
回复
0
查看
783
SUNSTONE的Delphi笔记
S
D
回复
0
查看
952
DelphiTeacher的专栏
D
后退
顶部