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

x
?
Solved

getting table names

Posted on 2008-10-01
8
Medium Priority
?
174 Views
Last Modified: 2010-03-19
It it the same in MS SQL, i need to get all my tables names and data would  SHOW TABLES work in MSSQL
0
Comment
Question by:pigmentarts
[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
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 16

Expert Comment

by:brad2575
ID: 22613057
you mean something like this:

SELECT     distinct(TABLE_NAME)
FROM         INFORMATION_SCHEMA.COLUMNS
0
 
LVL 12

Author Comment

by:pigmentarts
ID: 22613106
brad2575 would that get all the tables in the database as it looks like i would have to know the table names, what if i did not knowa the names and wanted to return a list of them?

aerion85: thats MYSQL not MS SQL right
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!

 
LVL 16

Expert Comment

by:brad2575
ID: 22613150
yes that would get a list of ALL the distinct/unique table names.  If you wanted to search to see if a specific table existed or not you would have to add that to the where clause.
0
 
LVL 4

Expert Comment

by:aerion85
ID: 22613177
oh damn, i'm sorry;o
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 22613232
please try this helps

select name from sysobjects where type='u' and name like '%yourtablename%'
0
 
LVL 12

Author Comment

by:pigmentarts
ID: 22613251
sorry, so does that mean if i just wanted to return a list of tables names without first knowing what they are called, then this would do?
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 2000 total points
ID: 22613298
select * from sys.tables
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

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