Groups | Blog | Home
all groups > sql server new users > january 2007 >

sql server new users : How to set data in SQL Server case sensitive, but database/table..


William Cai
1/30/2007 2:17:01 AM
Hello folks,
Is there an option in SQL Server to set all data case sensitive, but
database/table/column name case-insensitive? I know it's possible to set
column collation to a case-sensitive one when creating individual table. I'm
looking for a system wide setting so that I need not specify it each time I
create a table.

Any comments are appreciated!

Thanks,
Steve
1/30/2007 4:50:33 PM
On Jan 30, 2:17 am, William Cai <William...@discussions.microsoft.com>
[quoted text, click to view]
Alter the database collation to an insensitive collation and each
column to sensitive.
William Cai
1/30/2007 11:50:00 PM

Thanks Steve for the response. There are hundreds of columns in my system. I
want a system wide setting to set all column to sensitive. Is that possible?



[quoted text, click to view]
Steve
2/1/2007 7:28:27 AM
On Jan 30, 11:50 pm, William Cai
[quoted text, click to view]

There are no buttons to push....You could always write a script that
would cursor through all user tables and columns (of a char type) and
execute an ALTER TABLE to change the COLLATE of each column.
Anthony Thomas
2/4/2007 2:34:53 AM
If the database collation is case insensitive when it is created, then the
system tables, which include the table definitions and column names, will be
case insensitive.

Then, whenever you create a table, you specify that the table collation be
case sensitive, then each character column's data will be case sensitive by
default without having to specify each one.

However, be aware, that if your default server collation is different from
these tables, then you could have tempdb issues since tempdb would acquire
the server-wide setting.

Best of luck.

Sincerely,


Anthony Thomas


--

[quoted text, click to view]

AddThis Social Bookmark Button