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 2005 Forums
 Transact-SQL (2005)
 How to get the CurrentDb name in a variable

Author  Topic 

Mathias
Posting Yak Master

119 Posts

Posted - 2007-03-16 : 09:10:27
Let's say, we are connected to the master database (use master). What select statement do I need to do to get 'master' as result of a select statement?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-16 : 09:14:34
select db_name()


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Mathias
Posting Yak Master

119 Posts

Posted - 2007-03-19 : 03:32:45
Thanks.
Go to Top of Page
   

- Advertisement -