Solved

Export Table Names to Excel from SQL Server

Posted on 2015-02-15
8
391 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
  • 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 12

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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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 12

Expert Comment

by:Jeff Darling
ID: 40610906
0
 
LVL 1

Accepted Solution

by:
hi4ppl earned 500 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 12

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

776 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