or perhaps from the SQL server itself?
That's simple, run this query:
select @@SERVERNAME
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a desktop application that connects to varying server computers' SQL databases based on the ODBC server name I manually plug into the ODBC DataSource. I'd like to display that server name in my application. Can someone help me figure out how to retrieve the 'connect to' server name from either the ODBC DataSource or perhaps from the SQL server itself?
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
or perhaps from the SQL server itself?
That's simple, run this query:
select @@SERVERNAME