About 1,230,000 results
Open links in new tab
  1. 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 …

  2. 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 …

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

    Dec 11, 2024 · How To Find Database Name In SQL Server. Let us discuss all those approaches individually. Approach-1: Using sys.databases. To find database name in SQL server, we can …

  4. sql server - Using variable for database name - Database

    Jul 13, 2015 · I am having difficulty in using a variable name for the database. The below script searches through all databases and finds database that match a certain condition. The …

  5. 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 is …

  6. SQL Server: how to get a database name as a parameter in a …

    Oct 15, 2010 · declare @sp_name nvarchar(200) = 'AnyDbStoredProcedure' -- EVERY DATABASE OBJECT YOUR SCRIPT REFERENCES MUST -- INCLUDE THE FULLY …

  7. Use Server name with database - Microsoft Q&A

    The T-SQL USE statement only allows a database name specification. It is up to the client application or tool to connect to the desired server before executing USE. SSMS (in SQLCMD …

  8. How to filter objects in SSMS 2016 - SQL Shack

    Mar 5, 2020 · In the SQL Server management studio, we can apply a filter on the following objects. The following are the filter criteria supported by the SQL Server Management Studio …

  9. How to dynamically qualify the database name in a query - SQLServerCentral

    Sep 21, 2006 · When we access a different database from a stored procedure or trigger, we need to qualify the table name with the database name. For example, to access database TestDB I …

  10. How to Find Database Name in SQL Server Management Studio?

    Oct 31, 2023 · In this SQL Server tutorial, you will learn to find database name in SQL Server Management Studio. You will understand how to find the name of the database through Object …

  11. Some results have been removed
Refresh