Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 list of all user tables in the given database

Author  Topic 

DDDD1212
Starting Member

1 Post

Posted - 2006-07-06 : 10:22:21
Hello friends !

I want to get list of all user tables in the given database using SQL query.

can somebody help me for that....

I am a web developer working with java and new to SQL server 2000 .

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-06 : 10:26:20
Select name from sysobjects where xtype='u' order by name

or

Select table_name from Information_Schema.Tables where table_type='BASE TABLE' order by table_name


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-07-06 : 10:29:18
or how about...

EXEC SP_TABLES

although I believe it includes system tables and views in the output !

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-06 : 10:41:30
quote:
Originally posted by harsh_athalye

or how about...

EXEC SP_TABLES

although I believe it includes system tables and views in the output !

Harsh Athalye
India.
"Nothing is Impossible"


Yes but that was not questioner asked for

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-07-06 : 11:59:57
howzabout

select table_name from information_schema.tables
where table_type = 'BASE TABLE'


Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-07 : 01:09:23
quote:
Originally posted by DonAtWork

howzabout

select table_name from information_schema.tables
where table_type = 'BASE TABLE'


Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)


I already suggested that in my first reply

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-07-07 : 09:45:41
i somehow missed that.. did you edit?

Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-07 : 09:51:34
quote:
Originally posted by DonAtWork

i somehow missed that.. did you edit?

Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)


See if you able to find Last edited by ...

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-07-07 : 09:52:03
Don,

Looks like you need more coffee


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-07 : 09:54:00
quote:
Originally posted by khtan

Don,

Looks like you need more coffee


KH




Yes it is

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-07-07 : 11:39:00
a WHOLE lot more.. wtf... i will go and cry in the corner now...

Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-07-07 : 11:41:43
rotflol!

quote:
Originally posted by DonAtWork

a WHOLE lot more.. wtf... i will go and cry in the corner now...

Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)



--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -