I have searched for this....but no solution. I want a single query which produces all table names and their column names..
Asked
Active
Viewed 577 times
0
-
3Every platform is different. Is this for Oracle, SQL Server, MS Access? Note: SQL is not SQL Server – Nick.Mc Aug 01 '17 at 05:08
-
Possible duplicate of [Concatenate many rows into a single text string?](https://stackoverflow.com/questions/194852/concatenate-many-rows-into-a-single-text-string) – Mansoor Aug 01 '17 at 05:13
2 Answers
1
I think this will give you what you want
SELECT COLUMN_NAME, TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS

asmgx
- 7,328
- 15
- 82
- 143
0
SELECT t.name AS TableName,
c.name AS ColumnName
FROM sys.tables t
INNER JOIN sys.columns c ON c.object_id = t.object_id;

ASpirin
- 3,601
- 1
- 23
- 32

Gagan Sharma
- 220
- 1
- 7