Advanced Installed SQL Server Failed to establish connection - sql-server

I'm using Advanced Installer Architect 17.5 to create an .exe setup file. During my installation process, I need to run some SQL Server queries.
When it comes to creating a SQL connection, I could not find the right configuration to help me pass the connectivity test.
I've tried many different scenarios, I've used SQL Server or SQL Server Native Client 10.0 to connect to the database. I've also used Windows authentication mode (Trusted Connection/Impersonate user) or database logins, but all of them lead to an error
Failed to establish connection
in the test process.
Can somebody point out what is my error in this process?
I've brought screen shot for details. Please not I've also disabled Impersonate User and tried to login but all of them failed.
I've used many configurations for Server parameter such as . or .\ServerName or local.
I've also tried SQL Server 2008 and SQL Server 2017. Using the same parameters I can connect to server using SQL Server Management Studio.

I would try a couple of things first (If you haven't done them already):
Make sure your server is configured to allow remote connections. You can check this in SQL Management Studio, right-click on your server, click 'Properties' and go to the 'Connections' section.
Make sure the ODBC driver to connect to SQL Server is installed. You can get it from here -> https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15

Related

SQL Server Databases missing after installing SQL Server Express

I installed SQL Server 2017 Express as a named Instance alongside my default instance. After rebooting once - both were showing but the I could not connect to SQL Server Express remotely. I then followed the instructions to enable IP on SQL Express using configuration manager and rebooted. Now I can connect remotely but my default instance is showing NO databases!
Also in configuration manager, SQL Server Services does not show any of my instances so that I can check they are running (this was the care even prior to enabling the IP address on the protocol, and when I knew it definitely was running as I could connect to it)
--
Update:
I discovered if I launch SQL Server Configuration Manager 2016 rather than "SQL Server Configuration Manager" I can see all my servers.
SQL Server 2016 appears to be running as is SQL Server Express. There is also a "MSSQLServer" that is stopped - think this may be SQL Server 2012. Not sure at this stage which one had the databases.
Ok so for anyone in a similar situation / panic. Do the following.
Look to see what other SQL Server configuration mangers are showing up. If you have installed multiple versions over the years chances are you'll see more than one.
Try using one of the later ones. You can see the file path too if you need it here.
If you manage to see a list of your database servers, check which are enabled and disabled. I had to disable SQL Server (SQLExpress) first before I could enable SQL Server (MSSQLServer), which in my case referred to SQL Server 2012.
If you want to have SQL Server Express running as a named server running alongside your default server, make sure you assign it a different port number (e.g. 1435) in the SQL Server Network Configuration>Protocols for SQL Express>TCP/IPALL section in SQL Server configuration manager.

Microsoft SQL Server Management Studio unable to connect to Server

I freshly installed Microsoft SQL Server on my machine and started it. When I try to connect to a server I use a . for the server name (which should point to the local machine from what I read?). However I get the following error:
So I went to the SQL Server Configuration Manager and checked under SQL Server Services, which seems to be empty.
How can I establish a connection?
Your services are not running.
Make sure you installed this.
The above answer was correct, however, you only installed the SQL Server Management Studio.
If you installed Express, downloaded from the Microsoft website you might want to download and create the server instance with the management studio. You will need to select if you want Windows authentication or SQL Server authentication using a username and password. Remember to add the current windows user for using either.
Here is SQL Server 2014 Express: http://msdn.microsoft.com/en-us/evalcenter/dn434042.aspx.
This will download everything you need to connect to a server.
Please let me know if you need more information.

SQL Server backend and Access frontend - ODBC Connection to SQL Server native client failed

I have a SQL Server 2008 database as a back end and Access as a front end. Is it required to have SQL Server Management Studio installed for Access to connect to the SQL database.
The SQL database is on a server not on my local machine. I just reconfigured my computer and have not installed SQL Server Management Studio yet. I was trying to open the database in Access but I get this error message saying:
ODBC Connection to SQL Server Native Client10.0 "Server name" failed.
So how can I get Access to connect to the SQL Server database without having SQL Server management studio?
Its not that you need SSMS, its that you need a driver for Access to talk to your database and SSMS installs that by default.
First install a driver, like this one and then Access should be able to connect.
Then, you need to make sure that your SQL Server instance is setup to be connected remotely. If you have other clients connecting to it, this is already set up. But make sure TCP/IP is enabled.
Finally, check your connection string.
Based on the error, I would guess that its one of the latter two problems. But trying those, perhaps you could post more information to narrow it down.

Can't attach database to SQL Server Enterprise, needs Express?

I already have SQL Server Enterprise 2012 on my PC and the service that is running is MSSSQLSERVER (found on SQL Server Configuration manager).
I am trying to attach a database which requires SQL Server Express!
I downloaded SQLEXPR_x64_ENU and installed it, unfortunately SQLEXPRESS is not shown in my Configuration manager.
What shall I do to attach this database?
The attempts I've done:
First I tried with SQL Server Management Studio: while attaching gives this problem message:
An error occurred when attaching the database(s). Click the hyperlink in the message column for details.
and the progress box shows:
Error occurred.
While I try to add a data connection to the database in VS2012 I receive these errors:
If I use Data Source "Microsoft SQL Server" I receive this message:
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
If I use Data Source "Microsoft SQL Server Database File" and I browse the database file, I get this error message:
A network related or instance specific error occurred while establishing oa 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 interface, error 52 - unable to locate a local database runtime installation. verify that SQL Server Express is properly installed ant that the local database runtime feature is enabled)
As you see SQL Server Express is required.
If you correctly installed SQL Express on a laptop that already had the MSDN developer version, you should see two instances in the services.
MSSQLSERVER - developer version
SQLEXPRESS - express version
SQL Express does not come with services like the SQL Server agent. But it should be listed as the database engine SQL SERVER (SQLEXPRESS) under the configuration manager, SQL Server Services.
Make sure this service is started as well as the Browser service. Under network configuration, make sure TCP/IP is enabled. Under client protocols make sure TCP/IP is enabled.
Since you have the development version of SQL Server, you can connect and manager the express instance like the default instance. Just use your SSMS query window with the correct TSQL.
Here is a link on my blog on how to create a database for attach.
http://craftydba.com/?p=1753
Please respond back if you still have issues with a screen shot or two of the settings I just discussed.

SQL Server Express usage with Pentaho (or any non-microsoft product)

I'm trying to connect a local SQL Server database to an ETL utility called Pentaho. Pentaho very easily connects to full versions of SQL server without issue.
I've set mixed mode authentication and created a sql server account for the sql server express instance that can be used to login through SSMS.
When I try to log in via Pentaho, I get errors about it not knowing what the server is, or the server not responding. I've tried {localhost, myip, localhost\SQLEXPRESS, myip\SQLEXPRESS, just SQLEXPRESS} as the server name (and SQLEXPRESS is the instance name).
I know I've had trouble connecting other programs to SQLEXPRESS databases in the past. Can someone tell me why it acts different than when using a full install of SQL Server and how I can get around these differences?
If SQL Server Express is on a different server, have you enabled TCP/IP protocol?

Resources