• 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic