«

»

Feb 10

Dynamics NAV: Get SQL Server Name for current installation

I recently wrote a little blog on how to determine, if the current installation is a multitenant installation. There are a few more useful things that you can do with the DLLS that are shipped with Dynamics NAV. I am going to add some more with different blog posts and hope that you will find them useful and don’t have to spend as much time as I needed until I found this.

I have tested this with NAV versions 2013 R2 and higher, it works in all versions. There are slight differences in the different versions, since you will have to reference the proper DLL for your version. The “Version=” part of the DLL listed below must be replaced with the following for each version.

 

NAV Version Version=
2017 10.0.0.0
2016 9.0.0.0
2015 8.0.0.0
2013 R2 7.1.0.0

I wrapped this is a function shown below. The function declares the following local variable:

Name: ServerUserSettings
Type: DotNet
Subtype: Microsoft.Dynamics.Nav.Types.ServerUserSettings.’Microsoft.Dynamics.Nav.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′

The first line instantiates the .NET variable, which is one of the DLLs that Microsoft ships with Dynamics NAV. And the next lines get the server name and the SQL instance name. If there is no instance, only the server is returned, otherwise the server\instance are returned.

1 ping

  1. Dynamics NAV: Get SQL Server Name for current installation | Pardaan.com

    […] Bron : Peter’s Blog/a> Lees meer… […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">