About 26,900,000 results
Open links in new tab
  1. How to Find Database Name in SQL Server Using Query?

    Oct 27, 2023 · To find database names in SQL Server using query, you have two ways: first, you can find the name of the database using the database ID, or you can use a function that …

  2. sql - Find out current database name (MSSQL) - Stack Overflow

    With the MSSQL queries below, you can check the current database: SELECT DB_NAME() GO master In addition, if you don't specify a database on sqlcmd, "master" database is used by …

  3. How To Find Database Name In SQL Server - DatabaseFAQs.com

    Dec 11, 2024 · Finding the name of the databases in SQL server is never difficult using the different approaches mentioned in this article. You can use sys.databases, sp_databases, …

  4. How to Display the Database Name in the Result of a Query?

    Jan 2, 2025 · The DB_NAME () function in SQL Server is a built-in function that retrieves the name of the current database or a specified database based on its database ID. This function …

  5. Get Database Names from SQL Server - Tutorial Gateway

    Here, we will show you how to Get database names in the Server. You can also use sysdatabases to get the list of databases available in the Server. Or, use the sp_databases …

  6. How to display the database name in the result of a query?

    Jan 14, 2024 · You can use the DB_NAME () function to fetch the name of the current database as an additional column. DB_NAME() AS [dbName]; I've actually used that DB_NAME function …

  7. How to get SQL Server database name

    Determining the name of the current SQL Server database can be essential for various tasks, including executing queries, managing database objects, and troubleshooting issues. There …

  8. Get Current Database Name in SQL Server using DB_NAME

    Let's use DB_NAME () function to get current database name. As you see in below screenshot, DB_NAME () function without any database id parameter returns the current SQL database …

  9. SQL SERVER - A Quick Note on DB_ID() and DB_NAME() - Get …

    Jan 13, 2011 · -- Get Current DatabaseID SELECT DB_ID() DatabaseID; -- Get Current DatabaseName SELECT DB_NAME() DatabaseName; -- Get DatabaseName from …

  10. How to query the name of the current SQL Server database

    Correct answer is SELECT DB_NAME () which has 46 points (46th is mine). You can get the instance name of your current database as shown below: See similar questions with these …

Refresh