Solved

getting table names

Posted on 2008-10-01
8
168 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
  • 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 4

Expert Comment

by:aerion85
ID: 22613064
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
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.

 
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 500 total points
ID: 22613298
select * from sys.tables
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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