Unable to connect to SQL Azure remotely from SSMS 2012 - sql

I am unable to connect to my SQL Azure database instance remotely using SQL Management Studio 2012. Firewall exception is in there for my local IP. I can connect successfully and admin the database using the browser based management link in my Azure account.
I just can't seem to connect to the database via SSMS or anything else like VS2012.
Here is the format I'm for my connection in SSMS:
Server Name: myservername.database.windows.net
Authentication: SQL Server Authentication
Login: myusername#myservername
Password: my-password
Connect to: (i've tried) "master", mydatabasename, <default>
Encryption: TRUE
Once again, I DO have the firewall rule active for my local IP address on the server instance of my Azure account.
When I attempt to connect, I receive this error:
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: SSL
Provider, error: 0 - the wait operation timed out.) (Microsoft SQL
Server, Error: 258)
When searching for that 258 error, I do not get many results related to SQL Azure. I appreciate any help.

Error 258 is generated due to some of the configuration within your machine if a secure network could be established between two endpoints and if one machine initiate secure channel. This problem could be very much machine specific and not SQL specific that why you did not find any resources on this regard.
Can you try using SQLCMD as described in the following troubleshooting guide and see if that works to isolate SSMS specific issues on the same machine:
http://social.technet.microsoft.com/wiki/contents/articles/1719.windows-azure-sql-database-connectivity-troubleshooting-guide.aspx
IF you capture and analyze network packets traffic you might be able to determine the root cause of connectivity error.

Related

Can Not connect to Remote SQL server named instance with port

Hi All We have a server where we have sql server 2008 as well as SQL server 2005 hosted on port 1444. Using SSMS, I am able to connect to 2008 instance without any problem. But when I try to connect to 2005 instance using following connection settings.
DEVDB1\SQL_2005,1444
SQL server authentication user name and password.
I get following error
"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 connection host has failed to
respond)(Microsoft SQL Server, Error: 10060)"
I am able to connect to another instance on the same server. but not this.
NOTE: My colleagues are able to connect to this sql server with the same settings. It just does not work from my machine. Me and all my colleagues are working on VPN and have same machine configuration.
Is there any setting that I need to do/check to get successfully connected?
My VPN user profile was restricting access to this perticular port. Once my VPN user profile is matched with those who were able to access, the problem resolved.

Working with SQL Azure from Starbucks

I have a SQL Azure database. For some reason, I can work with it when I'm at home, but not when I'm at Starbucks. I can successfully login to it and "manage" it via the web-based tool provided from the Windows Azure Portal. However:
When my web app tries to hit the database, I receive an error that says:
The provider did not return a ProviderManifestToken string.
When I try to hit the database from SQL Management Studio, I receive the following error:
Cannot connect to tcp:[serverName],[number].
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.)
(Microsoft SQL Server, Error: 10060)
I know my IP Address is unblocked, because as mentioned, I can use the web-based tool. I know the database is setup properly, because I can use it from home. However, when I seem to try to work from any local coffee shop, I'm stuck.
Thanks
the Web based Azure Portal doesn't use your local IP address to connect to your databases, it uses the ip address of the server hosting the portal.
since you're getting a new IP from coffee shops, either you add that in the Azure SQL Firewall or you open up your Azure SQL to all IPs.
if that doesn't work, then maybe your local coffee shop has firewall setting blocking port 1433...

SQL Azure Database Named Pipes Error

Up until last night, my site (hosted by DiscountASP.net) and the SQL Azure database that it connects to were running normally.
For some reason, during the night, the site went down with a named pipe error. Error 40.
Having prefixed the server name with "tcp:" in the connection string, the error is now:
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.)
So, just to be clear, the web.config file did not change at all between the time the website last worked and the item the named pipe error came up.
Now, the username, password and instance name are all correct since the site runs locally against the remote SQl Azure server perfectly.
I've checked the instance name and the SQl Azure access rules, ensuring that the web server's IP address is whitelisted.
Any ideas on whats wrong?
If I understand this right, your local website (on-premise) can connect to SQL Azure, but your website deployed in Azure can't?
Make sure your firewall rules has the "allow other windows azure services to access this server". Checking this option off basically prevents any azure-hosted application/service from connecting to your database.

SQL Azure : Connection to SQL Azure throws exception

When I connect to SQL Azure from my code, I get the following error.. I am able to connect to SQL Azure from SQL Server Management Studio successfully.
System.Data.SqlClient.SqlException: 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 - The requested name is valid, but no data of the requested type was found.)
I also tried connecting using sqlCMD and that connects without any issue. Only issue arises is during runtime when I get this exception.
You might also want to check to make sure your firewall allows outbound connections on port 1433.
There can be numerous reasons for this failure, I am listing out the scenarios and the options that needs to be allowed on the server.
If you are connecting an Azure SQL Instance using Sql server management studio while inside you company's network/firewall, first of all you will need to check if your company's firewall rules allow that or not.
On the AZURE SQL Server, make sure your IP address is in the allowed list.
I believe you just need to tick the checkbox "Allow other Windows Azure services to access this server" in Firewall Rules on your SQL Azure account (this will allow connecting to the db server from your deployed Azure application). Hope this helps.
It would be helpful if you post your connection string here. Also a sample app on connecting to sql azure using ado.net: http://msdn.microsoft.com/en-us/library/windowsazure/ee336243.aspx
Makesure you pay attention to the SqlConnectionStringBuilder properties.
If you have your IP added into firewall rules and allowing SQL
connection to Azure Services Enabled. It should work fine!

Unable to Connect to SQL Server 2005 Db From Vista x64 Windows Service

I'm trying to connect to a remote SQL Server 2005 db from a .NET Windows service running in Vista Home Premium x64. I can access the remote db from a console app with no problem. I can connect to a local db from the Windows service with no problem. I was able to connect from a service from XP with no problem. There's no firewall or anti-virus running. How do I configure this service to be able to connect to the remote db?
I've tried to connect by running the Windows service as a local admin account, LocalSystem, LocalService, and NetworkService.
The connection string:
Data source=SERVER_NAME;Initial Catalog=DB_NAME;Integrated Security=True;
The error:
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
MORE INFO:
I have also tried to connect using SQL Server authentication with no success:
Data Source=SERVER_NAME;User ID=USER_ID;Password=PWD;Initial Catalog=DB_NAME
This connection string works from the console app too.
MORE INFO:
I ran Process Monitor for the Windows Service and the console app. The Windows service showed \SERVER_NAME\pipe\sql\query was ACCESS DENIED but the console app showed SUCCESS when reading/writing files to \SERVER_NAME\pipe\sql\query.
Good Lord! Why all the gibberish and complex responses on this site. Create a User Account
Either local or Domain and set the service to use that account. Then go into your SQL Server and Add you new account to the Database and set permissions. Voila!
Oh yeah, dont plague yourself with SQL Authentication. Integrated Security is much easier to maintain and without a password in your web.config your much safer.
1) open a command prompt. Type "ping SERVER_NAME". Does it respond? You may have a DNS or connectivity issue if this doesn't work.
2) "telnet SERVER_NAME 1443". Do you see anything or does it refuse your connection? This will definitively tell you whether or not someone is listening on the other end.
3) Go into SQL Server Management Studio. Right click Properties of your server. Select "Connections" from the left side. Is "Allow Remote Connections" checked?
4) Since you're running using network service/system, you will need to make sure you have a login configured on your server for the machine account DOMAIN\CLIENTSYSTEMNAME$. Note the $ sign. This is your machine account, and this will be the user that SQL Server will see.