Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid object name 'information_schema.columns' in SQL Server

The following query used to work:

select * from information_schema.columns where column_name like ...

But now it's throwing an error:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'information_schema.columns'.

The application was upgraded but the view still has to exist in the database.

like image 579
ErikE Avatar asked May 16 '11 21:05

ErikE


People also ask

What is the INFORMATION_SCHEMA in SQL Server?

INFORMATION_SCHEMA provides access to database metadata, information about the MySQL server such as the name of a database or table, the data type of a column, or access privileges. Other terms that are sometimes used for this information are data dictionary and system catalog.

What is INFORMATION_SCHEMA columns in MySQL?

The INFORMATION_SCHEMA. COLUMNS view allows you to get information about all columns for all tables and views within a database. By default it will show you this information for every single table and view that is in the database.


1 Answers

Either:

  1. The database has a case-sensitive collation, try all upper case INFORMATION_SCHEMA.COLUMNS.
  2. Or you don't have permission.

(This question was asked by a coworker and didn't seem to be on the site so I asked and answered it.)

like image 95
ErikE Avatar answered Oct 01 '22 11:10

ErikE