在SQL2005的SQL Server Management Studio中,右键打开表,输入数据,竟然发现输入不了中文,![](/Emoticons/QQ/04.gif)
开始以为是我的输入法(极点五笔)的问题,换用微软拼音还那样,
查看字符集
sp_helpsort
Chinese-PRC, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive
不过是可以向里面control +V中文的.
最后在zjcxc(邹建)解决的问题里找到了解决办法
CREATE TABLE [dbo].[Game](
[ID] [int] IDENTITY(1,1) NOT NULL,
[GameName] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NOT NULL,
[IsAvailable] [int] NOT NULL CONSTRAINT [DF_Game_IsAvailable] DEFAULT ((1)),
CONSTRAINT [PK_Game] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
因为第一列ID为IDENTITY列,所以在打开表的时候整行都是只读,所以输入的时候就会无法录入中文
CREATE TABLE [dbo].[Game](
[GameName] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NOT NULL,
[ID] [int] IDENTITY(1,1) NOT NULL,
[IsAvailable] [int] NOT NULL CONSTRAINT [DF_Game_IsAvailable] DEFAULT ((1)),
CONSTRAINT [PK_Game] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
改成这样就可以了.把IDENTITY列放到后面
.