There is a way to know the name of the Database Server

Asked

Viewed 4,693 times

4

There is an sql command that can inform the server and the database in which select is running?

I am available for more details

1 answer

4

Yes. You can use the following select.

select @@SERVERNAME, DB_NAME()
  • Opa, veleu. I also managed to find by SELECT * FROM sys.Servers that besides the server shows the links of other Servers. The only problem is that I would like to know what the name of the server Alias is. Exists as?

  • @Emanuelf, server alias? Refers to DNS or virtualhost?

  • A name has been assigned to the server. We have a name pointing to the server.

  • the @@SERVERNAME does not carry that name?

  • Yes, it brings the name: SRV1 but I have assigned to it the name: dbDWserver1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.