|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, December 02, 2009 12:19 AM
Points: 108,
Visits: 248
|
|
hi,
In my database I created one table and add one column.
column name is : column1 ..
when i used select query select .
select COLUMN1 FROM table ..
it showing data.. how can i change the database to case sensitive.. I am using sql server 2005 ctp expressedition..
regards: giri...
Thanks Dastagiri.D
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 4:19 AM
Points: 1,593,
Visits: 1,025
|
|
So whats the proble it must not show column1 when give COLUMN1.
I dont think there is an option for that.
Tanx
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:26 AM
Points: 2,293,
Visits: 1,099
|
|
Hi,
you can change the server collation, check http://msdn.microsoft.com/en-us/library/ms179254.aspx
Regards, René
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, October 15, 2010 8:23 AM
Points: 371,
Visits: 437
|
|
Note that you can also change your database, or table collation as well (if you don't want your entire server running that way)
So if you're using SQL_Latin1_General_CP1_CI_AS, try SQL_Latin1_General_CP1_CS_AS
ALTER DATABASE COLLATE SQL_Latin1_General_CP1_CS_AS
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 5:02 AM
Points: 2,365,
Visits: 1,825
|
|
Why do you want to change to case sensitive?
"Keep Trying"
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, March 29, 2011 2:59 PM
Points: 473,
Visits: 606
|
|
You do not have to change the database or column collation in order to use different collations for specific tasks. In fact you can mix collations to match your needs.
If you have your database built with case insensitve collation but would like to do case sensitive search just use the COLLATE keyword.
For example the first select will find all records where test code is 'ABC' regardless of the case - so abc, AbC aBc and such will be found. The second one will find only the record matching the case of the specified string 'ABC' in this case. The third example will mix the case sensitive and case insensitive search in one query.
SELECT * FROM Tests WHERE TestCode = 'ABC'
SELECT * FROM Tests WHERE TestCode = 'ABC' COLLATE Latin1_General_CS_AS
SELECT * FROM Tests WHERE TestCode = 'ABC' COLLATE Latin1_General_CS_AS OR TestCode = 'CBS'
--------------------------------------------- Nothing is impossible. It is just a matter of time and money.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 5:52 AM
Points: 908,
Visits: 2,797
|
|
Note that changing server or database collation does NOT change the collation for pre-existing columns/data. There's only one way to do that: Create a brand new empty database in the desired collation and migrate the data into that DB.
Simplest thing to do is to use the COLLATE option, though (as mentioned above).
MSSQLTIPS just had an article on that today: slightly different context but same issue
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 1:56 PM
Points: 1,658,
Visits: 8,564
|
|
Read about it at http://www.db-staff.com/index.php/microsoft-sql-server/69-change-collation
MJ
|
|
|
|