File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL Query Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Query Problem" Watch "SQL Query Problem" New topic
Author

SQL Query Problem

Ram Mohan
Greenhorn

Joined: Oct 21, 2005
Posts: 26
Hai friends,
I need some help.

I know the name of database.How can I query to get the details of tables , stored procedures and views corresponding to this database.

I just know the name of stored procedures is stored in the sysobjects system table and the text is stored in the syscomments system table in the current database.
But I don't know to access it with only knowing the database name.I am using ms sql server.

Ram Mohan.
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Originally posted by Ram Mohan:

I know the name of database.How can I query to get the details of tables , stored procedures and views corresponding to this database.

I just know the name of stored procedures is stored in the sysobjects system table and the text is stored in the syscomments system table in the current database.
But I don't know to access it with only knowing the database name.I am using ms sql server.



Run this query in analyser pointing to ur Database.

note the xtype, This will tell u if the object is table or view or whatever.
things i know are
PK - primary Key
U - tables
V - views
F - foreign Keys
Ram Mohan
Greenhorn

Joined: Oct 21, 2005
Posts: 26
Thankyou Ram It gives me the LIFE.

Ram Mohan.
 
 
subject: SQL Query Problem
 
Similar Threads
what are procedures in sql ?
How can I get the list of only user defined Stored Procedures?
SQL Server 2000 Create Table
stored procedures
How to call stored procedures in ejb2.1?