473,366 Members | 1,197 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,366 software developers and data experts.

finding out table names

jay
I'm fairly new to sql.

I've got a database that all I want to do is view some records from
some tables. But the thing is, I do not know the table names or
their relationships.

I've got access to the database thru query analyzer. Can someone
assist me in gettign the correct statements that will allow me to find
out what tables exist in the database.
Jul 20 '05 #1
4 1242
Hi Jay

This should get you started

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"jay" <no******@notmail.com> wrote in message
news:41***************@news.individual.NET...
I'm fairly new to sql.

I've got a database that all I want to do is view some records from
some tables. But the thing is, I do not know the table names or
their relationships.

I've got access to the database thru query analyzer. Can someone
assist me in gettign the correct statements that will allow me to find
out what tables exist in the database.

Jul 20 '05 #2
jay
On Mon, 26 Jul 2004 21:04:39 +0100, "Allan Mitchell"
<al***@no-spam.sqldts.com> wrote:
Hi Jay

This should get you started

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'

--


Thank you, and my persistent searches while waiting also lead me to:

SELECT * FROM sysobjects WHERE type = 'U'

& simply

SELECT * FROM INFORMATION_SCHEMA.TABLES

which was enough to get me started to find the table I was looking for
and then extract the information I needed.

The statement you gave did not quite give me what I was looking for,
I'm not sure what it is that it gave me.
Jul 20 '05 #3
a.b
> The statement you gave did not quite give me what I was looking for,
I'm not sure what it is that it gave me.


It gave you all the tables in the database (leaving out views).
Jul 20 '05 #4
If you are using the same Query Analyzer I use, hit F8. That
brings up the Object Browser, which shows you the names of
everything.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ben | last post by:
Hi In a list I have a number of soccer players. Each player has a different rating for attacking, defending, midfield fitness and goalkeeping. I have devised a while loop that goes through...
3
by: David Berry | last post by:
Hi All. I'm trying to write an ASP page that shows me the UNIQUE account number for a customer (so I can pass it to another page) based on a search criteria. For example, I want to do a select...
5
by: Chad | last post by:
Could any suggest to me a good way to programmatically identify which SPs update a database column. I would like to create a cross reference for our database.
6
by: Maxi | last post by:
I have 100 tabes in an Access database, every table has 1 filed with 100 names (records), no primary key assigned. I would like to find duplicates. Here is the criteria: The computer should...
10
by: Dixie | last post by:
I need to delete some relationships in code. How do I know what the names of those relationships are?
0
by: Jorge | last post by:
Hi Jy In the OleDbDataAdapter.SelectCommand.CommandText = "Select from Table where FieldName like '% " & variable & "%'" Kind Regards Jorge >-----Original Message-----
2
by: Bob Johnson | last post by:
Using C#/2.0 I'm writing a small "data translator" utility app that reads data out of a MS Access database and inserts it into a SQL Server database. The source db lists a bunch of names of people...
2
by: Pete90 | last post by:
I am trying to write a Javascript to find the entire row in a table with the highest grades and highlight it. But nothing happens except the table is shown. In this case, the grades are represented...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.