0

i want to collect the details of complete tables and views of a specific database, especially here i want only tables/views with its columns structure. Example : Database having around 561 Tables and Views, please give me a query or some alternate help to achieve it.

1 Answers1

0

This query will return the required data:

SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION,
   COLUMN_DEFAULT, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH,
   NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE,
   DATETIME_PRECISION
FROM INFORMATION_SCHEMA.COLUMNS
ORDER BY TABLE_NAME

Taken from the following SO question and adding and ORDER BY clause:

Getting list of tables, and fields in each, in a database

Community
  • 1
  • 1
Tanner
  • 22,205
  • 9
  • 65
  • 83