Solved

getting table names

Posted on 2008-10-01
8
166 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
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.

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL server is using more virtual memory. 5 83
sql query 8 48
Error Creating Foreign Keys in SQL Database 7 34
SQL Server 2012 rs - Sum each category by month 4 32
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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