MS SQL: List All Columns in all Tables

Modified on Thu, 31 Jul at 3:04 PM

SELECT  tables.name AS table_name,
        all_columns.name AS column_name,   
        types.name AS system_data_type
FROM sys.tables
 INNER JOIN sys.all_columns ON tables.object_id = all_columns.object_id  
 INNER JOIN sys.types ON all_columns.system_type_id = types.system_type_id AND all_columns.user_type_id = types.user_type_id   
WHERE tables.is_ms_shipped = 0  
ORDER BY tables.name, all_columns.name

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article