C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




sql querry


Posted Date: 10 Jul 2006      Total Responses: 11

Posted By: damodar       Member Level: Bronze     Points: 2


what is the querry to get all the tables in a database?




Responses

Author: ManoKarthikeyan    10 Jul 2006Member Level: SilverRating:     Points: 2
show tables;


Author: vishal     10 Jul 2006Member Level: GoldRating:     Points: 2
To get all tables in the database you can write select statement as –

SELECT * FROM sysObjects where xtype = ā€˜U’

U means user tables


Author: Vimal Verma    10 Jul 2006Member Level: GoldRating:     Points: 2
select * from sys.tables


Author: divya    13 Oct 2008Member Level: GoldRating:     Points: 1
select * from sysObjects where Xtype='U'
or
select * from sys.tables where type='U'


Author: Kavitha    13 Oct 2008Member Level: SilverRating:     Points: 1
To get all the tables, use sp_tables in a paticuler DB.


Author: Deepika Haridas    07 Nov 2008Member Level: DiamondRating:     Points: 0
show tables;


Author: Mohammed Khaja Najmuddin    10 Nov 2008Member Level: GoldRating:     Points: 1
This will display information of all tables .
select * from information_schema.tables;


Author: surya prakash B.G.    11 Nov 2008Member Level: SilverRating:     Points: 5

Below queries gives only objects in table

select * from sysObjects

You can different objects based on XType field in where clause

for User Tables
Xtype = 'U'

for View
Xtype='V'

for procedures
Xtype='P'

for Scalar Functions
Xtype = 'FN'


Below query gives tables & view information
select * from information_schema.Tables

Below query gives View & View text information
select * from information_schema.Tables






Author: Rajalakshmi    13 Nov 2008Member Level: BronzeRating:     Points: 1
hi...

Simply u use the query

sp_tables under ur database


Author: amarababu naragam    18 Nov 2008Member Level: GoldRating:     Points: 1
sql server 2000

select name from sysobjects where type ='u'

it will display only tables


Author: Sriman N Vangala    19 Nov 2008Member Level: DiamondRating:     Points: 4
Various alternatives are there in order to get all the tables information

In sql server 2005, we can use the following

sp_tables
or
SELECT * FROM sys.Objects where type = 'U'
or
select * from sys.tables
or
select * from information_schema.tables where table_type= 'BASE TABLE'

In sql server 2000, we can use the following

SELECT * FROM sysObjects where xtype = 'U'



Post Reply
You must Sign In to post a response.
Next : Horizontal Scroll Bar for a listview control
Previous : sql querry interview question
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

UK Conference calling Company

Contact Us    Privacy Policy    Terms Of Use