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 |
|
Sean_B
Posting Yak Master
111 Posts |
Posted - 2007-05-17 : 09:04:29
|
| Hi,How do I get the database name and the server name from within a database session ?Sean |
|
|
sshelper
Posting Yak Master
216 Posts |
Posted - 2007-05-17 : 09:06:24
|
| To get the database name, you can use the DB_NAME() function:SELECT DB_NAME()SQL Server Helperhttp://www.sql-server-helper.com |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-17 : 09:06:37
|
[code]select db_name(), serverproperty('servername')[/code] KH |
 |
|
|
Sean_B
Posting Yak Master
111 Posts |
Posted - 2007-05-17 : 09:10:08
|
| Thank you, much appreciated.Sean |
 |
|
|
|
|
|