Quantcast
Channel: .NET Framework inside SQL Server forum
Viewing all articles
Browse latest Browse all 780

Get Server Name from CLR without making a SQL query?

$
0
0

Is there a way to get the current Server Name (essentially @@SERVERNAME or @@SERVICENAME) inside a CLR C# procedure without connecting and making a query to the instance?

Right now it opens a connection using "context connection=true" and makes this query:

    SELECT @@SERVERNAME

However, is there a global property of some sort that has that information already?

Thanks.


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>