Solved

getting table names

Posted on 2008-10-01
8
165 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
Comment Utility
you mean something like this:

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

Expert Comment

by:aerion85
Comment Utility
0
 
LVL 12

Author Comment

by:pigmentarts
Comment Utility
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
 
LVL 16

Expert Comment

by:brad2575
Comment Utility
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 4

Expert Comment

by:aerion85
Comment Utility
oh damn, i'm sorry;o
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
Comment Utility
please try this helps

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

Author Comment

by:pigmentarts
Comment Utility
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
Comment Utility
select * from sys.tables
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

12 Experts available now in Live!

Get 1:1 Help Now