Loading, please wait...
Ghoul To World!
Ask and Learn.
Home
Feed
Photos
Chat
Chrome Addons
Showing posts with label
varchar
.
Show all posts
Showing posts with label
varchar
.
Show all posts
Sunday, November 2, 2008
ms sql中char与varchar使用注意
張貼者:
GreatGhoul
於
Sunday, November 02, 2008
今天把数据库换成了mssql,因为对其数据类型不是很熟悉,存储时使用了char来存储字符串,结果读该字符串到一个textfield时,竟然是空白,还以为是自己程序出了问题了呢,把值读出来才发现后面加了长长一串空格。回到表中一看,果然如此,char(我设置的长度是10),长度不够的字条串后面都用空格补上了。改成varchar,删除空格,一切ok.
当然也可以通过程序中修改,获取字条串后先trim一下。
转载声明: 出自:
Ghoul To World!
作者:
GreatGhoul
Older Posts
Home
Subscribe to:
Posts (Atom)
Subscribe To
Posts
Atom
Posts
All Comments
Atom
All Comments
Search Box
About Me
Great Ghoul
New Post
|
Customize
|
View My Profile
Recent Posts
Loading...
Shared Items
Loading...
Guest Book
Blog Archive
February 2010
(1)
October 2009
(2)
September 2009
(1)
May 2009
(5)
April 2009
(5)
March 2009
(10)
February 2009
(2)
January 2009
(2)
December 2008
(9)
November 2008
(32)
October 2008
(10)
September 2008
(11)
August 2008
(11)
July 2008
(3)
June 2008
(6)
May 2008
(2)
April 2008
(4)
March 2008
(4)
December 2007
(2)
November 2007
(10)