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.
Asked
Active
Viewed 132 times
1 Answers
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: