摘要: 比如select @status = N'stopped'那么其中的字符串 stopped 前面为什么要加 N 呢?而且我们发现有些地方加 N 与否都没有影响,有些地方又必须加 N。N 在这里表示 Unicode,就是双字节字符。对于西文字符,用一个字节来存储过足够了,对于东方文字字符,就需要两个字节来存储。Unicode 为了统一、规范、方便、兼容,就规定西文字符也用两个字节来存储。也就是说加 N 就表示字符串用 Unicode 方式存储。但有时候加与不加都一样,又是什么原因呢?这是由于自动转换造成的。比如:declare @status nvarchar(20)select 阅读全文
posted @ 2013-12-10 20:58 YoMe 阅读(2119) 评论(0) 推荐(0) 编辑
摘要: use PersonAlter table Student alter column Sno char(5) not null;Alter table Student Add constraint uq_sno unique(Sno);Alter table Student Add constraint C_sex check(Ssex in('男','女'));Alter table Student Add constraint df_Sage Default 20 for Sage;Alter table Student Add constraint ... 阅读全文
posted @ 2013-12-10 10:28 YoMe 阅读(757) 评论(0) 推荐(1) 编辑