Create ExternalSQL Connection whit New-NAVTableConnection to a server different than NAV Server

Hi All,

for a customer I need to connect to a NAV External Table which is located on a SQL DB located on a remote server.

The remote Server is connect to domain and I login with Windows User.

My problem is that when creating the connection to the table from Powershel with the New-NAVTableConnection function, while specifying the credentials (both of the NAV server and of the remote server) it returns me the following error:

New-NAVTableConnection: Could not establish connection to SQL Server or database.

The reasons could be the following:
* SQL Server is not started.
* The database does not exist.
* The NAV server account does not have the correct permissions.

The function is the follow:

New-NAVTableConnection -ConnectionId MyConnectionID -ConnectionType ExternalSQL -ApplicationDatabaseServer MyNAVServerName -ApplicationDatabaseName MyNAVDatabaseName -DatabaseServer MyRemoteServerName  -DatabaseName MyRemoteDatabseName -ApplicationDatabaseCredentials $Credentials -DatabaseCredentials $Credentials

where the $Credential is a valid Domain PSCredential.

In my opinion, an important detail is that looking at the remote DB from the Management Studio, you see a blue icon with a question mark instead of the green icon next to the server name

pastedimage1617033060521v1.png

Did you confirm if the NAV Service account (the account the Service Tier runs with) has proper access to that other db?

Yes, on both DB the windows user is dbowner