title: How to query the name of the current SQL Server database instance?
body: <p>It is a bit of a "chicken or egg" kind of query, but can someone dreamup a query that can return the name of the current database instance in which the query executes? Believe me when I say I understand the paradox: why do you need to know the name of the database instance if you're already connected to execute the query? Auditing in a multi-database environment.</p>
  
  <p>I've looked at all the @@ globals in Books Online. "<code>SELECT @@servername</code>" comes close, but I want the name of the database instance rather than the server.</p>