SQL SERVERÐÞ¸ÄÅÅÐò¹æÔò
1.sp_helpsort
SELECT SERVERPROPERTY ('Collation')
²é¿´ÄãµÄÅÅÐò¹æÔò.
²»¹ýÄãµÄÕâ¸öÓ¦¸ÃºÍ×Ö·û¼¯ÓйØ.
2.¸ü¸Ä·þÎñÆ÷ÅÅÐò¹æÔò
¸ü¸Ä SQL Server 2005 ʵÀýµÄĬÈÏÅÅÐò¹æÔòµÄ²Ù×÷¿ÉÄÜ»á±È½Ï¸´ÔÓ£¬°üÀ¨ÒÔϲ½Ö裺
È·±£¾ßÓÐÖØд´½¨Óû§Êý¾Ý¿â¼°ÕâЩÊý¾Ý¿âÖеÄËùÓжÔÏóËùÐèµÄÈ«²¿ÐÅÏ¢»ò½Å±¾¡£
ʹÓù¤¾ß£¨ÀýÈç´óÈÝÁ¿¸´ÖÆ£©µ¼³öËùÓÐÊý¾Ý¡£
ɾ³ýËùÓÐÓû§Êý¾Ý¿â¡£
ÖØÐÂÉú³ÉÔÚ setup ÃüÁîµÄ SQLCOLLATION ÊôÐÔÖÐÖ¸¶¨ÐµÄÅÅÐò¹æÔòµÄ master Êý¾Ý¿â¡£ÀýÈ磺
¸´ÖÆ´úÂë
start /wait setup.exe /qb INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=test SQLCOLLATION=SQL_Latin1_General_CP1_CI_AI
ÓйØÖØÐÂÉú³É master Êý¾Ý¿âµÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄÈçºÎÖØÐÂÉú³É SQL Server 2005 µÄ Master Êý¾Ý¿â¡£
´´½¨ËùÓÐÊý¾Ý¿â¼°ÕâЩÊý¾Ý¿âÖеÄËùÓжÔÏó¡£
µ¼ÈëËùÓÐÊý¾Ý¡£
×¢Ò⣺
¿ÉÒÔΪ´´½¨µÄÿ¸öÐÂÊý¾Ý¿âÖ¸¶¨Ä¬ÈÏÅÅÐò¹æÔò£¬¶ø²»¸ü¸Ä SQL Server 2005 ʵÀýµÄĬÈÏÅÅÐò¹æÔò¡£
3.ÉèÖú͸ü¸ÄÊý¾Ý¿âÅÅÐò¹æÔò
´´½¨ÐÂÊý¾Ý¿âʱ£¬¿ÉÒÔʹÓÃÏÂÁÐÄÚÈÝÖ®Ò»Ö¸¶¨ÅÅÐò¹æÔò£º
CREATE DATABASE Óï¾äµÄ COLLATE ×Ӿ䡣
SQL Server Management Studio.
SQL ¹ÜÀí¶ÔÏó (SMO) ÖÐµÄ Database.Collation ÊôÐÔ¡£
Èç¹ûδָ¶¨ÅÅÐò¹æÔò£¬ÔòʹÓ÷þÎñÆ÷ÅÅÐò¹æÔò¡£
¿ÉÒÔʹÓà ALTER DATABASE Óï¾äµÄ COLLATE ×Ó¾äÀ´¸ü¸ÄÔÚÓû§Êý¾Ý¿âÖд´½¨µÄÈκÎжÔÏóµÄÅÅÐò¹æÔò¡£Ê¹ÓôËÓï¾ä²»Äܸü¸ÄÈκÎÏÖÓÐÓû§¶¨ÒåµÄ±íÖÐÁеÄÅÅÐò¹æÔò¡£Ê¹Óà ALTER TABLE µÄ COLLATE ×Ó¾ä¿ÉÒÔ¸ü¸ÄÕâЩÁеÄÅÅÐò¹æÔò¡£
¸ü¸ÄÊý¾Ý¿âÅÅÐò¹æÔòʱ£¬ÐèÒª¸ü¸ÄÏÂÁÐÄÚÈÝ£º
Êý¾Ý¿âµÄĬÈÏÅÅÐò¹æÔò£¬ÕâһеÄĬÈÏÅÅÐò¹æÔò½«Ó¦ÓÃÓÚÊý¾Ý¿âÖкóÐø´´½¨µÄËùÓÐÁС¢Óû§¶¨ÒåµÄÊý¾ÝÀàÐÍ¡¢±äÁ¿ºÍ²ÎÊý¡£¸ù¾ÝÊý¾Ý¿âÖж¨ÒåµÄ¶ÔÏó½âÎö SQL Óï¾äÖÐÖ¸¶¨µÄ¶ÔÏó±êʶ·ûʱ£¬Ò²Ê¹ÓÃеÄĬÈÏÅÅÐò¹æÔò¡£
½«ÏµÍ³±íÖеÄÈκΠchar¡¢varchar¡¢text¡¢nchar¡¢nvarchar »ò ntext Áиü¸ÄΪʹÓÃеÄÅÅÐò¹æÔò¡£
½«´æ´¢¹ý³ÌºÍÓû§¶¨Ò庯ÊýµÄËùÓÐÏÖÓÐ char¡¢varchar¡¢text¡¢nchar¡¢nvarchar »ò ntext ²ÎÊýºÍ±êÁ¿·µ»ØÖµ¸ü¸ÄΪʹÓÃеÄÅÅÐò¹æÔò¡£
½« char¡¢varchar¡¢text¡¢nchar¡¢nvarchar »ò ntext ϵͳÊý¾ÝÀàÐͺͻùÓÚÕâЩϵͳÊý¾ÝÀàÐ͵ÄËùÓÐÓû§¶¨ÒåµÄÊý¾ÝÀàÐ͸ü¸ÄΪʹÓÃеÄĬÈÏÅÅÐò¹æÔò¡£
SQL code :
1.½«Êý¾Ý¿âµÄ×Ö·û¼¯ÐÞ¸ÄΪ£º
alter database dbname collate Chinese_PRC_CI_AS
2.
--1. ΪÊý¾Ý¿â
Ïà¹ØÎĵµ£º
ÔÚ½øÐÐÊý¾Ý¿â²Ù×÷ʱ£¬Î޷ǾÍÊÇÌí¼Ó¡¢É¾³ý¡¢Ð޸ģ¬ÕâµÃÉè¼Æµ½Ò»Ð©³£ÓõÄSQLÓï¾ä£¬ÈçÏ£º
SQL³£ÓÃÃüÁîʹÓ÷½·¨£º
(1) Êý¾Ý¼Ç¼ɸѡ£º
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû=×Ö¶ÎÖµ order by ×Ö¶ÎÃû [desc]"
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû like %×Ö¶ÎÖµ% order by ×Ö¶ÎÃû [desc]"
sql="select top 10 * fro ......
1.×Ö·û´®º¯Êý £º
datalength(Char_expr) ·µ»Ø×Ö·û´®°üº¬×Ö·ûÊý,µ«²»°üº¬ºóÃæµÄ¿Õ¸ñ
length(expression,variable)Ö¸¶¨×Ö·û´®»ò±äÁ¿Ãû³ÆµÄ³¤¶È¡£
substring(expression,start,length) ²»¶à˵ÁË,È¡×Ó´®
right(char_expr,int_expr) ·µ»Ø×Ö·û´®ÓÒ±ßint_expr¸ö×Ö·û
concat(str1,str2,...)·µ»ØÀ´×ÔÓÚ²ÎÊýÁ¬½áµÄ×Ö·û´®¡£dat ......
¿ÉÄÜ´ó¼Ò»¹²»ÊǶÔSQL×¢ÈëÕâ¸ö¸ÅÄî²»ÊǺÜÇå³þ£¬¼òµ¥µØ˵,SQL×¢Èë¾ÍÊǹ¥»÷Õßͨ¹ýÕý³£µÄWEBÒ³Ãæ,°Ñ×Ô¼ºSQL´úÂë´«Èëµ½Ó¦ÓóÌÐòÖÐ,´Ó¶øͨ¹ýÖ´ÐзdzÌÐòÔ±Ô¤ÆÚµÄSQL´úÂë,´ïµ½ÇÔÈ¡Êý¾Ý»òÆÆ»µµÄÄ¿µÄ¡£
¡¡¡¡µ±Ó¦ÓóÌÐòʹÓÃÊäÈëÄÚÈÝÀ´¹¹Ô춯̬SQLÓï¾äÒÔ·ÃÎÊÊý¾Ý¿âʱ£¬»á·¢ÉúSQL×¢Èë¹¥»÷¡£Èç¹û´úÂëʹÓô洢¹ý³Ì£¬¶øÕâЩ´æ´¢¹ý³Ì×÷Ϊ°üº ......
----start
SQL(Structured Query Language)£¬Ò²¾ÍÊǽṹ»¯²éѯÓïÑÔ£¬Ëü±»Éè¼ÆÓÃÀ´²Ù×÷¼¯ºÏµÄ£¬ÊǷǹý³Ì»¯µÄÓïÑÔ¡£Ëæ×ÅÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÒµÎñÂß¼Ô½À´Ô½¸´ÔÓ£¬´«Í³µÄSQLÒѾ²»ÄÜÂú×ãÈËÃǵÄÒªÇó£¬ÓÚÊÇÈËÃǶÔSQL½øÐÐÁËÀ©Õ¹£¬Ê¹Ëü¾ßÓÐÁ˹ý³Ì»¯µÄÂß¼£¬¼´£ºSQL PL¡£SQL PLµÄÈ«³ÆÊÇ SQL Procedural Language£ ......
±¾ÎĽÚÑ¡×ÔMSDNµÄÎÄÕ¡¶ÎåÖÖÌá¸ß SQL ÐÔÄܵķ½·¨¡·£¬Ìá³öÈçºÎÌá¸ß»ùÓÚSQL ServerÓ¦ÓóÌÐòµÄÔËÐÐЧÂÊ£¬·Ç³£ÖµµÃÍƼö¡£¶ÔһЩTrafficºÜ¸ßµÄÓ¦ÓÃϵͳ¶øÑÔ£¬ÈçºÎÌá¸ßºÍ¸Ä½øSQLÖ¸ÁÊǷdz£ÖØÒªµÄ£¬Ò²ÊÇÒ»¸öºÜºÃµÄÍ»ÆƵ㡣
*ÎÄÕÂÖ÷Òª°üÀ¨ÈçÏÂһЩÄÚÈÝ£¨Èç¸ÐÐËȤ£¬ÇëÖ±½Ó·ÃÎÊÏÂÃæµÄURLÔĶÁÍêÕûµÄÖÐÓ¢ÎÄÎĵµ£©£º
1, ´Ó INSE ......