Determine Current Databases' Name
I have an application that will be deployed onto at least 3 servers and the SQL Server 2000 DB will be named differently on each server. I have a routine that runs as part of the monthly closing procedures which creates a backup to file of the current database. This works fine when I know the name of the database, but is there a way to query for the name of the current database?
PS - This needs to be runnable by a DataReader/DataWriter, if possible.
Re: Determine Current Databases' Name
I knew that as soon as I posted this, I would find something...
SELECT DB_NAME()