SQL ServerµÄ¶¨Ðò(Collation)
ʹÓÃSQL ServerµÄÅóÓÑ們應該¶¼ÖªµÀSQL ServerµÄ資ÁÏ庫ÓÐÒ»個設¶¨½Ð×ö¶¨Ðò(Collation)£¬½ñÌìÎÒ們¾Í來¿´¿´¶¨Ðò這東Î÷ÊÇʲ麼£¬Ê×ÏÈÎÒ們¿´Ò»ÏÂWikiÉÏ對¶¨ÐòµÄ說Ã÷£º
Collation is the assembly of written information into a standard order. One common type of collation is called alphabetisation, though collation is not limited to ordering letters of the alphabet. Collating lists of words or names into alphabetical order is the basis of most office filing systems, library catalogs and reference books..[Reference from here.]
這¶Î話講µÃÐþÁË點£¬ÎÒ們¿´ÁíÒ»個±È較Ò×¶®µÄ說Ã÷£º
Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.[Reference from here.]
這¶Î話¾Í簡潔¶àÁË£¬簡單來說¶¨ÐòÖ¸µÄ¾ÍÊÇ決¶¨資Áϱ»ÅÅÐò與±È對µÄ規則£¬¶ø±È對µÄ規則Ò»°ã¿É´Ö·Ö為幾´ó類£º
¶¨ÐòµÄ·Ö類
Case sensitivity(CS)
簡單來說¾ÍÊÇ區·Ö´óС寫£¬A¸úaÊDz»Í¬µÄ£¬Èç¹ûÊÇCase Insensitive(CI)µÄ話AÔÚÅÅÐò»òÕß²é詢時¾Í會±»視為Ïàͬ£¬Ò²¾ÍÊDzé詢A£¬連ͬaÒ²會±»²é詢µ½¡£
Accent sensitivity(AS)
´ú±íµÄÊÇÇ»調ÉϵIJî別£¬a¸úá¡¢o¸úóÔÚÇ»調ÉÏÊÇÏàͬµÄ£¬ÄDzé詢時ÊÇÒª視為Ïàͬ£¬Èç¹ûÊǵÄ話£¬ÄǾÍÊÇAccent Insensitive(AI)£¬Èç¹û²»ÊǵÄ話¾Í視為Accent sensitive¡£
Kana Sensitivity(KS)
ÈÕÎÄÖÐµÄÆ¬¼ÙÃû(Hiragana)與ƽ¼ÙÃû(Katakana)Èç¹û±»視為Ïàͬ£¬ÄǾÍÊÇKana Insensitive(KI)£¬·´Ö®¾ÍÊÇKane sensitive.¡£
Width sensitivity(WS)
當°ëÐÎ×Ö與È«ÐÍ×Ô±»視為Ïàͬ(A¸ú£Á)£¬ÄǾÍÊÇWidth Insensitive(
Ïà¹ØÎĵµ£º
Á¬½Ó²éѯ£¬¾ÍÊǽ«
Á½¸ö»ò¶à¸ö
±í»òÊÓͼ
ͨ¹ýÒ»¶¨µÄÌõ¼þ
½«È«²¿»ò²¿·Ý×Ö¶Î
È«²¿»ò²¿·Ý¼Ç¼
Á¬½Óµ½Ò»Æð£¬µÃµ½Ò»¸öеÄÊý¾Ý¼¯ºÏ¡£
È磺ÓÐÈËÔ±µµ°¸ºÍ¹¤×ʵµ°¸Á½¸ö±í£¬Á½¸ö±íÓй²Í¬µÄ¹Ø¼ü×Ö¶ÎXMDM(ÐÕÃû´úÂ룩£¬ÆäÖÐÈËÔ±µµ°¸´æ´¢ÁËÈËÊÂ×ÊÁÏ£¬¹¤×ʵµ°¸´æ´¢ÁËн³ê×ÊÁÏ¡£
Òò´Ë¿ÉÒÔͨ¹ýXMDM×ֶν«Á½¸ö±íÁ¬½ÓÆðÀ´£¬´Ó¶øÊ¹²éѯ½ ......
sql»Ö¸´xp_regread
ɾ³ýµôxp_regreadºó£¬·¢ÏÖÒÔǰµÄ×÷Òµ²»Äܲ鿴£¬Ö»ÄÜÈ¥»Ö¸´ÁË¡£
exec sp_addextendedproc 'Xp_dirtree','xpstar.dll' »Ö¸´ºó·¢ÏÖ²»ÄÜʹÓÃ
ÕÒµ½dbcc addextendedproc ("Xp_regread","xpstar.dll") »¹ÊDz»ÄÜʹÓÃ
ºóÀ´²Å·¢ÏÖ»Ö¸´µÄʱºòÒªÓÃСдdbcc addextended ......
ÀûÓÃhibernateµÄQuery½øÐÐÖ±½ÓÖ´ÐÐSQLÓï¾ä
Ò»¡¢
String sql = "insert into SHOP_MALL_ACCOUNT_MAP_T (MALL_NO,ACCOUNT) values ('"
+ mallNo + "','" + userId + "')";
SQLQuery query = getSession().createSQLQuery(sql);
query.executeUpdate();
¶þ¡¢
String sql = "select to_char(SYN_DATE,' ......
Select
CONVERT(varchar, getdate(), 1),--mm/dd/yy
CONVERT(varchar, getdate(), 2),--yy.mm.dd
CONVERT(varchar, getdate(), 3),--dd/mm/yy
CONVERT(varchar, getdate(), 4),--dd.mm.yy
CONVERT(varchar, getdate(), 5),--dd-mm-yy
CONVERT(varchar, getdate(), 1 ......
Èç¹ûûÓÐÔ¶³ÌÊý¾Ý¿âËùÔÚ·þÎñÆ÷µÄwindowsÕ˺ÅÃÜÂ룬½öÓÐÔ¶³ÌSQL ServerÊý¾Ý¿âµÄÓû§ÃÜÂ룬¸ÃÈçºÎ±¸·ÝÔ¶³ÌÊý¾Ý¿âdb1µÄÊý¾Ýµ½±¾µØÄØ£¿
1£ºÔÚ±¾µØ°²×°Í¨°æ±¾µÄÊý¾Ý¿âÈí¼þ£¨±ÈÈ磺SQL Server2000£©
2£ºÔÚ±¾µØÊý¾Ý¿â·þÎñÆ÷ÉÏ´´½¨Êý¾Ý¿âdb2£»
3£ºÊ¹Óñ¾µØ“ÆóÒµ¹ÜÀíÆ÷”×¢²áÔ¶³ÌÊý¾Ý¿â£¬²¢½ ......