Solved

Export Table Names to Excel from SQL Server

Posted on 2015-02-15
8
281 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
 

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

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…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now