HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How do you export a database schema from SQL Server Management Studio to Excel?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
studioyouexcelsqldatabasemanagementexporthowserverfrom

Problem

As part of a web migration process, a vendor has asked for our database schema without the data records (for confidential purposes). They want a MS Excel file with each database table. I am completely new to working with databases. Is there an easy way to do this in SQL Server 2014 Management Studio?

Solution

You can link your server as Data Source in Excel and then run this query:

SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE'


This will export data into Excel

How to connect SQL server to Excel:
https://support.office.com/en-us/article/Connect-a-SQL-Server-database-to-your-workbook-22c39d8d-5b60-4d7e-9d4b-ce6680d43bad

Or if database is not that big then just run it in Management Studio and copy-paste the result to Excel

Code Snippets

SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE'

Context

StackExchange Database Administrators Q#148737, answer score: 6

Revisions (0)

No revisions yet.