Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ecpro
Starting Member
2 Posts |
Posted - 2007-01-06 : 00:06:38
|
| Hello. I work on a proprietary software package at work that has a SQL query engine. I'm able to query tables that I know exist but I would like to know what other tables are there in the db. Unfortunately I don't know the name of the database. Is there a SQL statement that will show me the name of the database that I'm running my query on?Thanks for your help. |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-01-06 : 00:46:31
|
to get the db name in sql server:select db_name()if you want to know what tables there are, you can use the INFORMATION_SCHEMA views, which are supported by many RDBMS (sql server included). eg:select * from INFORMATION_SCHEMA.TABLESwill show you all tables and views. www.elsasoft.org |
 |
|
|
ecpro
Starting Member
2 Posts |
Posted - 2007-01-08 : 11:34:38
|
| Thanks!!! That did the trick. Appreciate your help!!! |
 |
|
|
|
|
|