Results 1 to 2 of 2

Thread: Determine Current Databases' Name

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    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.
    My.Settings.Signature = String.Empty

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: Determine Current Databases' Name

    I knew that as soon as I posted this, I would find something...

    SELECT DB_NAME()
    My.Settings.Signature = String.Empty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width