![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have several databases on a SQL2005 server. All were created the same way, using the SQL Server Management Studio create new database wizard. On ONE and ONE ONLY of those databases if I try to generate a list of tables in that database using: select table_name from information_schema.tables where table_type = 'BASE TABLE' order by table_name I get the following error: Invalid object name 'information_schema.tables'. If I check the list of system views with the object browser, the view is indeed there. This works just fine for all of the other databases on the same server. Any ideas why I am getting this error? |
#3
| |||
| |||
|
|
Joe Cool (joecool1... (AT) live (DOT) com) writes: I have several databases on a SQL2005 server. All were created the same way, using the SQL Server Management Studio create new database wizard. On ONE and ONE ONLY of those databases if I try to generate a list of tables in that database using: select table_name from information_schema.tables where table_type = 'BASE TABLE' order by table_name I get the following error: Invalid object name 'information_schema.tables'. If I check the list of system views with the object browser, the view is indeed there. This works just fine for all of the other databases on the same server. Any ideas why I am getting this error? It's spelled INFORMATION_SCHEMA.TABLES. Which does not matter in a database with a case-insensitive collation, but in a database with a case-sensitive or binary collation it does. |
#4
| |||
| |||
|
|
I changed the collation to SQL_Latin1_General_CP1_CI_AS with Alter Database and all is well. |
#5
| |||
| |||
|
|
Joe Cool (joecool1... (AT) live (DOT) com) writes: I changed the collation to SQL_Latin1_General_CP1_CI_AS with Alter Database and all is well. I recommend against using that collation, or more generally against SQL collations in general. They are legacy collations, and there can be some severe performance problems if you have varchar in your tables, but you have a client that works with nvarchar by default. This combination has a performance impact with Windows collations, but they are usually far less severe. |
#6
| |||
| |||
|
|
I was not aware that you could define a database with no collation. |
![]() |
| Thread Tools | |
| Display Modes | |
| |