sql – Is there a way to know the name of the Database Server

Question:

Is there a sql command that can inform the server and the database in which the select is being executed?

I'm available for more details

Answer:

Yes. you can use the following select .

select @@SERVERNAME, DB_NAME()
Scroll to Top