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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Get Database Name using T-Sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-17 : 08:47:26
Femi writes "Hi All,

I ve been trying to get the DbName of the Database I m connected to in Query Analyser. I cant find a T-SQL function for this. The C-function in BooksOnline cant be used or I dont know how to go about it.

Please assist

I m using MS-SQL 2000

Thanks in advance
Femi"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-02-17 : 08:48:58
Those pesky underscores:

SELECT DB_NAME()

I can almost guarantee that this is what the C function calls.
Go to Top of Page
   

- Advertisement -