if object_id('test')is not null drop table test
go
create table test(Id int ,[name] varchar(10) collate Chinese_PRC_CS_AS)
insert test select 1,'A'
insert test select 2,'a'
insert test select 3,'adad'
insert test select 4,'Dads'
select * from test where [name] like '%a%'  collate Chinese_PRC_CI_AS
/*Id          name       
----------- ---------- 
1           A
2           a
3           adad
4           Dads*/

解决方案 »

  1.   

    if object_id('test')is not null drop table test
    go
    create table test(Id int ,[name] varchar(10) collate Chinese_PRC_CS_AS)
    insert test select 1,'A'
    insert test select 2,'a'
    insert test select 3,'adad'
    insert test select 4,'Dads'
    select * from test where [name] like '%a%'  --collate Chinese_PRC_CI_AS
    /*Id          name       
    ----------- ---------- 
    2           a
    3           adad
    4           Dads*/
      

  2.   

    我把数据库和表的排序规则都改成了Chinese_PRC_CI_AS
    但是还是不行,请问是什么原因。
    select * from Product where name like '%dvd%'
    select * from pRoDuct where name like '%Dvd%'
    结果不一样,但是表明已经不区分大小写了,只是like 后边的字段还是区分大小写,请教应该怎么修改?