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 - 2002-01-03 : 10:07:07
|
| Hagit writes "Is there's a way to detect the databse name i'm curently working on?i know there is a global variable for the @@SERVERNAME.but i can't find any stored proc nor global variable to help me get current db_name..." |
|
|
hagitz
Starting Member
2 Posts |
Posted - 2002-01-03 : 10:16:56
|
| yes. but that gives ALL the databases the exists and not ONLY the current one.the 'db_name' that is shown in the upper box of the query analizer. |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-01-03 : 10:23:09
|
| HiDid you try :select db_name()Damian |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-01-03 : 10:37:36
|
quote: yes. but that gives ALL the databases the exists and not ONLY the current one.the 'db_name' that is shown in the upper box of the query analizer.
From above: If no ID is specified, the name of the current database is returned. ===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
|
|
|