🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #805

[MS FAQ] ����SQL Server�Դ�Сд/����������

#805
From: Galaxy��VOLUNTEERS��Database
Date: Mon, 10 Nov 2008 08:23
63 lines
4097 bytes
Q: �������SQL Server�Դ�Сд/���������У�

A:
SQL Server��Ĭ�ϰ�װ��Ϊ��Сд�����еġ�
Ĭ������£���������SQL���᷵����ͬ�Ľ��
use AdventureWorks
go
select * from  sales.customer ----��ȷ
select * from  Sales.Customer ----��ȷ


����ͨ������SQL Server���������ʹ��ݿ⡢���洢��̶Դ�Сд���С�
�ַ������ͱȽ������������ƣ���ͬ�����Ժ͵����Ӧ��ͬ���������


ͨ�����²�ѯ���ܻ��ϵͳ���е�collation��
select * from ::fn_helpcollations()


ͨ�����²�ѯ���ܻ���ض���ݿ��collation��
SELECT databasepropertyex('TestDB','collation')


ͨ�����·�����Ҳ���Բ�ѯ�ض�����������ݿ⣬���洢��̵��������
�Ҽ�-������-����չ����-���������


�������ĸ�ʽΪChinese_PRC_CI_AI_WS
ǰ�벿�ݣ�ָUNICODE�ַ�Chinese_PRC_ָ��Դ�½������UNICODE���������
�������ĺ�벿�ݼ���׺ ���壺 
����_BIN ���������� 
����_CI(CS) �Ƿ���ִ�Сд��CI����֣�CS���
����_AI(AS) �Ƿ����������AI����֣�AS��֡�����
����_KI(KS) �Ƿ���ּ�������,KI����֣�KS��֡�
    _WI(WS) �Ƿ���ֿ�� WI����֣�WS��֡� 
��ִ�Сд:������ñȽϽ���д��ĸ��Сд��ĸ��Ϊ���ȣ���ѡ���ѡ�
�������:������ñȽϽ������ͷ�������ĸ��Ϊ���ȣ���ѡ���ѡ����ѡ���ѡ��
��
         �Ƚϻ���������ͬ����ĸ��Ϊ���ȡ�
��ּ���:������ñȽϽ�Ƭ�����ƽ��������������Ϊ���ȣ���ѡ���ѡ�
��ֿ��:������ñȽϽ�����ַ��ȫ���ַ���Ϊ���ȣ���ѡ���ѡ�


SQL Server�ڰ�װ�������Ĭ����������ѡ�����á�
ͨ����alter database��ѯ�������COLLATE <Ŀ���������>�������޸���ݿ��Ĭ
���������
ALTER DATABASE AdventureWorks COLLATE Chinese_PRC_CS_AI_WS
ʹ�����ƵIJ�ѯ���Ҳ���Ըı�����������洢��̵��������

���޸�֮����������SQL���᷵�ز�ͬ���
use AdventureWorks
go
select * from  sales.customer ----����
select * from  Sales.Customer ----��ȷ

ǰһ����ѯ�������ʱ�ᱨ���´���
can't resolve collation conflict equal to operation
--
Welcome to Database Board
��ӭ������ݿ��
http://bbs.sjtu.edu.cn/bbsdoc?board=database

�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 207.46.55.31]
Technical Details
Message-ID: <4d0QSc$aql@bbs.sjtu.edu.cn>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.neu.edu.cn!news.shec6.edu.cn!SJTU

Show Full Headers
Complete Article Headers
X-Google-Thread: 101948,e422c60af41733,start
X-Google-Attributes: gid101948,domainid0,public,usenet
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.neu.edu.cn!news.shec6.edu.cn!SJTU
From: Dem.bbs@bbs.sjtu.edu.cn (Galaxy��VOLUNTEERS��Database)
Newsgroups: cn.bbs.comp.database
Subject: [MS FAQ] ����SQL Server�Դ�Сд/����������
Date: 10 Nov 2008 08:23:11 GMT
Organization: ��ˮ˼Դ
Message-ID: <4d0QSc$aql@bbs.sjtu.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: database/M.1226305382.A
Lines: 62