Connection to external SQL Server database

Connection to external SQL Server database


I'm trying to set a connection to a local database running on my machine. In the Service Center I added a new connection with the following connection string:
  • user id=sa;password=<hidden>;data source = <ip>,1433; initial catalog = <database name>; trusted_connection=yes;
With that connection string I'm obtaining the following error:

Connection String test failed: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

I've also tried attaching to the connection string the following, but with no success:
  • network = DBMSSOCN;
  • integrated security = no;
  • integrated security = yes (and using windows authentication)
Am I doing something wrong defining this connection? Any tips?

Thanks in advance,
Does the SQL Server instance has a name, if so you have to specify it:

data source = <ip>\<instance>

Check this site, it has some examples:

Also check if the servers can communicate with each other. (firewall, etc.)
I've tried those combinations and I'm getting the error I've shown in the first post as well as this one:

Connection String test failed: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I've tested the connection with an UDL file and there seems to be no issues.
I've allowed remote connection in SQL Server and defined the connection through the port 1433. Also, I allowed the connection in the firewall.
Is there a way of testing the server communication? (firewall, etc)

This is a generic connection error, so there is one of two problems:

1. The connection string is wrong or has some typo;
2. Your OutSystems Server can't connect with the external SQL Server;

Are you using instance names?
- If so, check if you have SQL Server Browser service running;

Did you check the firewall in your SQL Server machine?
- Create a rule for the instance service;
- Create a rule for the browser service;

Does your instance has TCP protocol enabled?
- If not, enable it.

Are you using the IP or the name of the SQL Server?
- If your are using the name make sure OS server can resolve it or try the IP

Are the 2 servers in the same network or domain?
Can you reach the SQL server instance from your machine through Management Studio?


I've tried everything you said and I think I found out the issue. I'm trying to connect through a network and the network is protected by firewall with configurations I can't change.

What I did next was to create a server using an Azure account, I allowed the IP and I connected using Service Center with success.

After that I used Integration Studio to connect to the external table but I'm getting a new error:

  1.So here is my connection correctly configured in the Service Center

  2. Here is the available connections in Integration Studio. I select Test Database and proceed.

  3. And this is the error I get. I've googled this error and got no good results. Does it have something to do with SQL Server being on the cloud, on an Azure account? 

Once again, thanks for the help.

Are you trying to integrate with Microsoft Azure SQL? If so, upgrade your OutSystems platform to the latest version 9.1.400.0:

What's new in 9.1.400.0
  • Improved security of applications generated code (#1202532)
  • Added support for integration with Microsoft Azure SQL (#1202530)
I'm afraid I'm already using the latest version of the platform.

Is this error caused by the version of SQL Azure I'm using?

I connected to the server with Microsoft SQL Server Management Studio and added some tables to the database. In that application I can't query the tables and the same error pops up:
  • Reference to database and/or server name in 'OST_TEST.dbo.Field' is not supported in this version of SQL Server.


I have the exact same problem as David. The problem is that Azure doesn't allow you to query the master database. However, when creating the database connection in Outsystems I already provide the database I want to use. The test connection went OK.

In Integration Studio I choose the database connection and then instead of showing the database I already specified, Outsystems is trying to create a list of available databases. For this it queries the master database, which is not allowed. 

Best solution is that Outsystems uses the database that is specified in the connection. Or is there another?

Best regards,

Peter Nijhuis.

I am also running into this issue during my eval of OutSystems? 

Is there a solution or workaround?

Hello David, Peter and Dwight

Can you tell me if in your ServiceCenter the DBMS dropdown in the Database Configurations has the option "SQL Server / SQL Azure"?

If you only have the "SQL Server" option, check if the Platform Server version is above 9.1.400.0. You can see this on the right side of the screen in Service Center.

As previously said, Azure is only supported after version 9.1.400.0 of the Platform Server. Currently the personal environments are running the 9.1.301.0 version which still does not support Azure.

Is there going to be a release of the personal environments in the near future with this support?  It would certainly assist in our evaluation.

Hi João,

I can confirm that I do NOT see the option SQL Azure in the screen you mentioned. I only see SQL Server. My version of Service Studio is 9.1.501.0 and I'm using the Personal Environment.

Thanks for your answer, however it is still a pity that we're not able to access an Azure database... :-)

Best regards,

Peter Nijhuis.

Hi Peter,

Running Service Studio and/or Integration Studio on 9.1.501 won't help you.

The connection to SQL Azure is a server-side feature and therefore does not depend on the version of the client-side tools. 

Your Personal environment on the OutSystems cloud should now be running 9.1.301, as you can check by browsing to https://<your_environment> Check the screenshot in Joao Amorim's reply for an example of how to check the version number.

The Personal environments are upgraded regularly, so it should be a matter of a few weeks.