[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Export Table Names to Excel from SQL Server

Posted on 2015-02-15
8
Medium Priority
?
1,083 Views
Last Modified: 2015-02-15
Does anyone know if it's possible to Export Table Names to Excel from SQL Server? I have a Db with several hundred tables and I'd like to capture the names in Excel. Not the properties, just the names. If this can't be done from within SQL Server, perhaps someone can recommend an affordable third party tool?
0
Comment
Question by:SpaceCoastLife
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 1

Expert Comment

by:hi4ppl
ID: 40610867
Hi,

it's possible with only a SQL code...

USE youDatabaseName
SELECT name FROM sys.tables

Open in new window


then export the result of that query to excel simple
0
 

Author Comment

by:SpaceCoastLife
ID: 40610888
The query works great but can you tell me more about how I export the result to Excel?
0
 
LVL 13

Expert Comment

by:Jeff Darling
ID: 40610899
you could use a data connection in excel.

under the data tab, then connections, add a connection.

here is a sample of a connection that points to a database and uses SQL.

db connection screenshot
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:SpaceCoastLife
ID: 40610903
Is that it? Please understand I am neither a sql expert or coder and have no idea how to implement your example. Isn't there a simpler way?
0
 
LVL 13

Expert Comment

by:Jeff Darling
ID: 40610906
0
 
LVL 1

Accepted Solution

by:
hi4ppl earned 2000 total points
ID: 40610911
can you tell me what you are using to run your query? if you are using sql server management studio then do the following

tools -> options -> query results -> SQl Server -> results to text (or grid if you want) -> Include columns headers in the result set

You might need to close and reopen SSMS after changing this option.

* On the SQL Editor Toolbar you can select save to file without having to restart SSMS

and here is a link that show you 2 other way of exporting that query result :D
0
 
LVL 13

Expert Comment

by:Jeff Darling
ID: 40610919
under the data tab is where you setup the data connection,

once have the data connection setup completed, then you can get external data using that connection.

Screenshot showing data tab
click the existing connections button and select the connection.

screenshot showing import dialog
0
 

Author Closing Comment

by:SpaceCoastLife
ID: 40610926
Got it! Thanks for the help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question