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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-10-24 : 08:29:25
|
| Anand writes "How do I get the name of the database presently I am working on?" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-10-24 : 08:30:09
|
| SELECT DB_NAME()You can also pass a database ID and get that DB's name:SELECT DB_NAME(2) --returns tempdb |
 |
|
|
|
|
|