Database Name

how do I retrieve the database name from the database itself

ELSNODE_51cdca37eb244029b9302a6260b125c1 is the database in SQL in our program we give it a Name I need to how to do a query for that name.

One way:

I need to send you a picture of what I mean, this forum will not let me, is there some other way I can contact you


the database SQL Name is: ELSNODE_d5c7f2aea2c54cd1b55fae4a6b69674c within it there is the name from our program called advantage, that is what I need to retrieve

There is a table - somewhere - that stores that information. You need to find that table and query it to return the name.

how do I find the table?

select *
  from sys.databases d
  where name = 'advantage'


If the column name is 'database_name':

Select object_name(object_id) From sys.columns Where name = 'database_name';

SELECT * FROM sys.database_principals this will give you all the name of dB on that server.

The system view sys.databases will have the name of every database on the server. Is that what you are looking for?
The system view sys.database_principals is data about database users and roles.