Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Case Sensitive database

Author  Topic 

Nelly
Starting Member

3 Posts

Posted - 2013-11-06 : 09:02:51
Hello

We have .NET application which access client's database to accomplish certain tasks. We execute all the queries using lower case....all was working fine till now. Now one of our new

client's database is case sensitive.

For instance:

The table name is DocumenTManaGement and column name is FileUploaded.

When we try to retrieve data by using the same queries....its giving the error below:

"Invalid object name 'DOCMAN.DocumenTManaGement '." for table name or "Invalid column name 'FileUploaded'." for column name.

Can anyone please assist us...how we can ignore this database's case sensitivity. Or generalise the queries to make it work.

Your help is much appreciated.

Thanks and Regards

Nelly

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-06 : 09:04:58
make collation as case insensitive. use ALTER DATABASE ..COLLATE statement for that

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Nelly
Starting Member

3 Posts

Posted - 2013-11-06 : 09:11:25
Thank you Visakh for your answer.

They not allowing us to create another instance of the database!! same as they not allowing us to alter the database collation.

any other suggestions?
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-11-06 : 12:33:39
I don't know what your application does or why it would lower-case things. But, I don't think there is a good solution for that on the SQL side of things. You could query the schema information and you can match that by specifying the collation. But, that would require you to query the schema information every time for every table to get the correct casing for each table and column name in that database.

The obvious alternative is to adjust your application to handle it or ask the client to change their DB or walk away from the project if it is going to cost you too much money to adjust your app.
Go to Top of Page

Nelly
Starting Member

3 Posts

Posted - 2013-11-06 : 13:30:33
Thanks for your suggestions Lamprey.

Go to Top of Page
   

- Advertisement -