Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a question on SQL

Status
Not open for further replies.

bernardsylunar

Programmer
Feb 9, 2005
25
PH
hi

i have a question about SQL. i don't know if it's simple or complicated..

my question is :
is there a way to view all the database on the SQL SERVER. including the database name, table name and field name.

is it possible?

thanks in advance

----
ynad
 
You can use system stored procedures in SQL Server to get the info you are looking for:

sp_HelpDB - lists all databases on the server
sp_Help - lists all objects in a database (including tables)
sp_Help [table name] - returns info about the table including fields

Hope this helps
 
You can query the INFORMATION_SCHEMA.SCHEMATA view to see what databases the current user has permission to see.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
thanks for your reply...

how about if i want to view them using visual basic.

here's what i want to do:
1. list all the database name a listbox
2. list all the tables of the currently selected database
3. retrieve all the fieldname and records

in a listview, i want the fieldname of a table to be the columnheaders and then list all the records in it.

i hope you'll understand my explanation

thanks guys


----
ynad
 
Hi and welcome to Tek-Tips. To get the best from these forums please read faq222-2244 carefully. For simple questions on getting started try the faq section (toolbar at top of this panel).

For this particular question there are several faqs (see ADO and SQL) including faq222-4845

If you then have a question on a particular problem, revisit faq222-2244 and then post the detailed question

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
Yup. First off you need to know how to run a query against a SQL Server. Only then can you apply one of the two methods above to answer your original question.

The FAQs will help greatly.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top