Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1288
  • Last Modified:

Change SQL server case sensitivity

Hi Experts
I have a big database (around 3000 tables) on SQL 2005 for which the collation is Latin1_General_BIN. It should be due to this, the table names and column names are case sensitive. We have developed a newer version of our application which talks to this database. The new application was developed on a test server/test db where the names are not case sensitive. Now wehn we try to   implement the new application, we realize that since the table names are case sensitive, the new application si giving error at many places. Is there an easy way to change the sql settings so that the original database/server is no more case sensitive?

Thanks.
0
bijualex
Asked:
bijualex
1 Solution
 
dev2devCommented:
As far my knowledge, you can refer db objects in any capitalization, in other words its case-insensitive
and that means

you can say "SELECT COL1,COL2  FROM MYTABLE"
or
"SELECT Col1,col2 from mYtABLE"

and so on.

What I feel is you better look at your application code,

I think your application stored db column/table names in a variables and does some comparison, focus there

Or am I wrong?
0
 
momi_sabagCommented:
well, you would need to change the collation, which can be a big task to perform
0
 
pivarCommented:
dev2dev,

If you have a case-sensitive collation references to db objects are case-sensitive.

Heres an link how to change it:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23185236.html

/peter

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
pivarCommented:
What you do is just:

alter database tablename collate Latin1_General_CI_AS
0
 
bijualexAuthor Commented:
I have tried to change the collation as specified in the above url. It gives me few erros saying that few constraints are dependent on database collation. I disabled these constraints, still I am getting the same error message. Any ideas?
0
 
bijualexAuthor Commented:
Removed those constraints, changed the collation and added the constraints. The table names can now be references in any case :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now