SQL ServerµÄ ÅÅÐò¹æÔò(collation)³åÍ»ºÍ½â¾ö·½°¸
ʲôÊÇÅÅÐò¹æÔò£¨collation£©
¹ØÓÚSQL ServerµÄÅÅÐò¹æÔò£¬¹À¼Æ´ó¼Ò¶¼²»Ä°Éú£¬ÔÚ´´½¨Êý¾Ý¿âʱÎÒÃǾ³£ÒªÑ¡ÔñÒ»ÖÖÅÅÐò¹æÔò£¨conllation£©£¬Ò»°ãÎÒÃÇ»áÁôÒ⵽ÿһÖÖÓïÑÔµÄÅÅÐò¹æÔò¶¼ÓÐÐí¶àÖÖ£¬±ÈÈç±ê×¼´ó½¼òÌåÖÐÎÄChinese_PRCµÄÅÅÐò¹æÔò¾ÍÓÐÊýÊ®ÖÖÖ®¶à
ÕâЩÅÅÐò¹æÔòÓÐʲô×÷ÓÃÄØ£¿ÈÃÎÒÃÇÏÈÀ´¿´¿´MS¹Ù·½µÄ½âÊÍ£º
ÅÅÐò¹æÔòÖ¸¶¨Á˱íʾÿ¸ö×Ö·ûµÄλģʽ¡£Ëü»¹Ö¸¶¨ÁËÓÃÓÚÅÅÐòºÍ±È½Ï×Ö·ûµÄ¹æÔò¡£ÅÅÐò¹æÔò¾ßÓÐÏÂÃæµÄÌØÕ÷£º
ÓïÑÔ
Çø·Ö´óСд
Çø·ÖÖØÒô
Çø·Ö¼ÙÃû
±ÈÈçÔÚSQL Server 2005ÖУ¬ÅÅÐò¹æÔòÃû³ÆÓÉÁ½²¿·Ý¹¹³É£¬±ÈÈç Chinese_PRC_CI_AI_WS
Ç°°ë²¿·ÝÊÇÖ¸±¾ÅÅÐò¹æÔòËùÖ§³ÖµÄ×Ö·û¼¯£¬ÈçChinese_PRC Ö¸Õë¶Ô´ó½¼òÌå×ÖUNICODEµÄÅÅÐò¹æÔò¡£
ºó°ë²¿·Ý¼´ºó׺µÄº¬ÒåÈçÏ£º
_BIN
Ö¸¶¨Ê¹ÓÃÏòºó¼æÈݵĶþ½øÖÆÅÅÐò˳Ðò¡£
_BIN2
Ö¸¶¨Ê¹Óà SQL Server 2005 ÖÐÒýÈëµÄÂëλ±È½ÏÓïÒåµÄ¶þ½øÖÆÅÅÐò˳Ðò¡£
_Stroke
°´±Ê»®ÅÅÐò
_CI(CS)
ÊÇ·ñÇø·Ö´óСд£¬CI²»Çø·Ö£¬CSÇø·Ö
_AI(AS)
ÊÇ·ñÇø·ÖÖØÒô£¬AI²»Çø·Ö£¬ASÇø·Ö
_KI(KS)
ÊÇ·ñÇø·Ö¼ÙÃûÀàÐÍ£¬KI²»Çø·Ö£¬KSÇø·Ö
_WI(WS)
ÊÇ·ñÇø·ÖÈ«°ë½Ç£¬WI²»Çø·Ö£¬WSÇø·Ö
¼ÈÈ»ÅÅÐò¹æÔòÈç´Ë¸´ÔÓ£¬ÄÇôӦÓÃÁ˲»Í¬ÅÅÐò¹æÔòµÄÁÐÖ®¼äĬÈÏÇé¿öϱ㲻ÄܽøÐÐUnion¡¢Join¡¢LikeµÈequal²Ù×÷ÁË£¬ÓÚÊDZãÓÐÁËÅÅÐò¹æÔò£¨collation£©³åÍ»¡£
ÅÅÐò¹æÔò£¨collation£©³åÍ»
ÎÒÃÇÖªµÀ£¬SQL Server ´Ó2000 ¿ªÊ¼£¬±ãÖ§³Ö¶à¸öÅÅÐò¹æÔò¡£SQL Server 2000 µÄÊý¾Ý¿â¿ÉʹÓóýĬÈÏÅÅÐò¹æÔòÒÔÍâµÄÆäËûÅÅÐò¹æÔò¡£´ËÍ⣬SQL Server 2000 »¹Ö§³ÖΪÁÐרÃÅÖƶ¨ÅÅÐò¹æÔò¡£
ÕâÑùÒ»À´£¬ÎÒÃÇÔÚд¿ç±í¡¢¿çÊý¾Ý¿â¡¢¿ç·þÎñÆ÷²Ù×÷µÄT-SQLʱ£¬Èç¹ûequalµÄ×Ö¶ÎÅÅÐò¹æÔò²»Í¬£¬±ã»á·¢ÉúÅÅÐò¹æÔò³åÍ»¡£
±ÈÈçÎÒÃÇÏȼûÁ½¸ö½á¹¹ÏàͬµÄ±í£¬µ«×ֶεÄÅÅÐò¹æÔò²»Í¬£º
-- 1. Create TableA.
CREATE TABLE TagsTableA
(
TagName NVARCHAR(64) COLLATE Chinese_PRC_BIN
)
-- 2. Create TableB.
CREATE TABLE TagsTableB
(
TagName NVARCHAR(64) COLLATE Chinese_PRC_CI_AS
)
µ±±í½¨ºÃÖ®ºóÖ´ÐУº
-- 3. Try to join them
Ïà¹ØÎĵµ£º
±ÈÈçij¸öÊý¾Ý¿â϶ÔSQL SERVERµÄÊý¾Ý¿â½øÐÐÁËÿÌìµÄ±¸·Ý£¬ÏÖÔÚÒª±£Áô7ÌìÒÔÄڵģ¬ÆäËûµÄɾ³ýµô£¬ÓÃASP¿ÉÒÔʵÏÖÁË£¬µ«ÒªÓõ½filesystemobject£¬²»´óˬ
Ê×ÏÈдһ¸öjsÎļþclearDatabaseBackup£¬ÄÚÈÝÈçÏÂ
function deleteBackupFile(beforedays) {
var fso = new ActiveXObject ......
SELECT TOP 33 id=identity(int,1,1) INTO #1 from sysobjects
SELECT A.id ,B.id,C.id,D.id,E.id,F.id
from #1 A,#1 B,#1 C,#1 D,#1 E,#1 F
WHERE A.ID<B.ID AND A.ID<C.ID AND A.ID<D.ID AND A.ID<E.ID AND A.ID<F.ID
AND B.ID<C.ID AND B.ID<D.ID AND B.ID<E.ID AND B.ID<F.ID
AND C.I ......
ΪÁË´ó¼Ò¸üÈÝÒ×Àí½âÎÒ¾Ù³öµÄSQLÓï¾ä£¬±¾Îļٶ¨ÒѾ½¨Á¢ÁËÒ»¸öѧÉú³É¼¨¹ÜÀíÊý¾Ý¿â£¬È«ÎľùÒÔѧÉú³É¼¨µÄ¹ÜÀíΪÀýÀ´ÃèÊö¡£
¡¡¡¡1.ÔÚ²éѯ½á¹ûÖÐÏÔʾÁÐÃû£º
¡¡¡¡a.ÓÃas¹Ø¼ü×Ö£ºselect name as 'ÐÕÃû' from students order by age
¡¡¡¡b.Ö±½Ó±íʾ£ºselect name 'ÐÕÃû' from students order by age
¡¡¡¡2.¾«È·²éÕÒ:
¡¡¡¡a.ÓÃ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â ......
2009-10-08 16:05
ʲôÊÇÊÓͼ
´ó¼Ò¶¼ÖªµÀ£¬ÎÒÃǹú¼ÒÏÖÔÚ“ÉñÆß”ÉÏÌìÁË¡£´ÓÃÀ¹úµÄÔÂÇòµÇÔ¿ªÊ¼£¬ÈËÀàÉÏÌì²»ÔÙÊÇÉñ»°¡£Ìý˵£¬ÔÚÃÀ¹ú£¬ÄãÖ»Òª³ö¼¸Ê®ÍòÃÀÔª£¬Äú¾Í¿ÉÒÔÉÏÒ»´ÎÔÂÇò½øÐÐÌ«¿ÕÂÃÐУ¬ËùÒÔ£¬ÎÒÃÇÏàÐÅ£ºÔÚ²»¾ÃµÄ½«À´£¬ÉÏÌìÂÃÐн«×ß½øÎÒÃÇ°ÙÐÕµÄÉú»î£¬ÄÇÊÇÒ»¼þ¶àôÐÂÏÊÉñÆæµÄÊÂÇé° ......