Link to home
Start Free TrialLog in
Avatar of giveindia
giveindia

asked on

Export Microsoft SQL Server Tables and columns into an excel file

I would like to export all the tables and column names of a said database to an excel file. What is the easiest way of going about this ?

Thanks,
Aditya
ASKER CERTIFIED SOLUTION
Avatar of Máté Farkas
Máté Farkas
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use the Import/Export wizard
User generated image
And when requesting the source query paste the following:
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
ORDER BY t.name, c.column_id

Open in new window

Avatar of giveindia
giveindia

ASKER

Thanks that worked great.