snippetMinor
How to disable case sensitivity in SQL Server 2005 for object name (Table name)?
Viewed 0 times
casesqldisablesensitivity2005nameforhowserverobject
Problem
I have created a new database in SQL Server 2005 and execute generated script from the old database.
In that I have a table called
When I try to execute the following query which has the table name in uppercase
I get an error
Invalid object name 'MSTCITY'
When I execute this
In the old database both
In that I have a table called
MstCity When I try to execute the following query which has the table name in uppercase
MSTCITYSELECT City FROM MSTCITY WHERE City = 'Junagadh'I get an error
Invalid object name 'MSTCITY'
When I execute this
SELECT statement it works fine SELECT City FROM MstCity WHERE City = 'Junagadh'In the old database both
SELECT statement work fine. And both database are in SQL Server 2005 only.Solution
Check the collation on the database. Then consider (but not flippantly) if it should be a CI (Case Insensitive) rather than a CS one.
Also look at the system databases. You may need to do a system rebuild to get it working right if you have built a system to migrate the database to. If your tempdb collation is different from the old box to the new one, you might find yourself with collation errors before too long.
Also look at the system databases. You may need to do a system rebuild to get it working right if you have built a system to migrate the database to. If your tempdb collation is different from the old box to the new one, you might find yourself with collation errors before too long.
Context
StackExchange Database Administrators Q#23179, answer score: 7
Revisions (0)
No revisions yet.