avatar
Memo Field一问# Database - 数据库
b*u
1
常看见书上说应该避免用Memo/OLE object field。
可是SQL Server里Varchar can take up to.. 4000 or 5000?
forgot. 有的时候确实不够啊。而如果用text, give it a size
of 16 will takes care of any big block of text.
再说,如果我用两个4000的varchar,是不是即使我insert一个几乎
为空的record, the system will still allocate 8000+ space for
this record? While use text, maybe only 50 bytes?
Memo field到底不好在哪儿呢?I've read something like "for
memo fields, it saves a pointer in the table, and all the data
is actually saved somewhere else..." so what?
avatar
a*a
2
Memo field is Access only.
SQLServer doesn't have Memo field. It has TEXT/NTEXT though.
varchar is called varchar because its length is variable. so when storing
a 40-byte string into a varchar(4000)field, only 40 bytes are used.

【在 b******u 的大作中提到】
: 常看见书上说应该避免用Memo/OLE object field。
: 可是SQL Server里Varchar can take up to.. 4000 or 5000?
: forgot. 有的时候确实不够啊。而如果用text, give it a size
: of 16 will takes care of any big block of text.
: 再说,如果我用两个4000的varchar,是不是即使我insert一个几乎
: 为空的record, the system will still allocate 8000+ space for
: this record? While use text, maybe only 50 bytes?
: Memo field到底不好在哪儿呢?I've read something like "for
: memo fields, it saves a pointer in the table, and all the data
: is actually saved somewhere else..." so what?

avatar
h*e
3
memo 是个老概念, 最常见于X-Base家族(dbase, foxbase, foxpro, clipper...)
的确memo type field在 dbf中只占一个pointer的地方, 所有数据存于另一个
文件中. 这个文件大小只跟OS有关. memo是很不适合查询的field, 而且memo文件
的存在使X-Base这种没有DBMS的数据库系统来说是个很不安全不干净的隐患.
SQL Server 的varchar 应该是不大于7000+, 所占字节不固定. 你说的那个例子是
char type.

【在 b******u 的大作中提到】
: 常看见书上说应该避免用Memo/OLE object field。
: 可是SQL Server里Varchar can take up to.. 4000 or 5000?
: forgot. 有的时候确实不够啊。而如果用text, give it a size
: of 16 will takes care of any big block of text.
: 再说,如果我用两个4000的varchar,是不是即使我insert一个几乎
: 为空的record, the system will still allocate 8000+ space for
: this record? While use text, maybe only 50 bytes?
: Memo field到底不好在哪儿呢?I've read something like "for
: memo fields, it saves a pointer in the table, and all the data
: is actually saved somewhere else..." so what?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。