Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL Query Problem

 
Ram Mohan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Ram It gives me the LIFE.

Ram Mohan.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!