SQL Server Metadata


SQL Server Metadata


The information schema is a method that SQL Server provides for retrieving metadata. You can query this schema to inspect SQL Server metadata, including lists of tables, columns, and other structural details on your linked SQL Server instance. The schema name that is used in SQL queries is INFORMATION_SCHEMA.

The following examples show common information schema queries:

Table Query

This query returns a list of tables that are available on your linked server:

SELECT * FROM CData2.cdata.INFORMATION_SCHEMA.tables

Columns Query

This query returns metadata about the columns in the Account table:

SELECT * FROM CData2.cdata.INFORMATION_SCHEMA.Columns WHERE Table_name='Account'

You can filter the results by specifying a table name.

Referential Constraints Query

This query returns metadata about foreign key constraints in your Salesforce tables:

SELECT * FROM CData2.cdata.INFORMATION_SCHEMA.Referential_Constraints 

Documentation

For more about the information schema, see System Information Schema Views in the Microsoft documentation.