SQL Server Data Dictionary

6

Hello, I come from the Oracle culture and I want to learn a little bit of SQL Server, I'm having trouble finding the SQL Server data dictionary, I've already looked at other forums and found nothing.

In Oracle we have a data dictionary that shows all the options of system views, such as which view lists all the tables in the database, which view lists all users, which view lists all the contraints the bank etc .. and usually when I do not know the name of the view I make one ( select table_name from dictionary where table_name like '%palavra_chave_aqui%' ) and I just find.

What is the equivalent in SQL Server for me to list all system views?

    
asked by anonymous 20.05.2018 / 01:58

1 answer

5
  

In Oracle we have a data dictionary that shows all the options of system views, (...)   What is the equivalent in SQL Server to list all system views?

This form is a particular implementation of Oracle Database.

As stated in Wikipedia, " In relational databases the information schema ( information_schema ) is an ANSI standard set of read-only views that provide information about all tables, views, columns, and procedures in a database. " SQL Server allows you to obtain metadata by this standard.

Each database in SQL Server contains its own information schema, named INFORMATION_SCHEMA. One way to get the metadata is

SELECT ...
  from bancodedados.INFORMATION_SCHEMA.objeto
  where ...

Available objects according to the ISO standard are detailed in the SQL Server documentation, starting with System Information Schema Views . For example, to list the tables in a database there is the TABLES .

In addition to SQL Server there are other database managers that allow you to get the metadata by the same method, such as MySQL, MariaDB, PostgreSQL, etc.

There are other ways to get the metadata in SQL Server, even with more information, but as an introduction it seems to me that using INFORMATION_SCHEMA will suffice. However, if you are interested in deepening your SQL Server metadata, you will find documentation about this at System Catalog Views .

Articles:

20.05.2018 / 20:21