Amazon Relational Database Service
User Guide (API Version 2013-02-12)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Connecting to a DB Instance Running the Microsoft SQL Server Database Engine

Once Amazon RDS provisions your DB Instance, you can use any standard SQL client application to connect to the instance. In this example, you connect to a DB Instance running the Microsoft SQL Server database engine using the Microsoft SQL Server command line tools. For information on connecting to a Microsoft SQL Server DB Instance using SSL, see Using SSL with a SQL Server DB Instance. For more information on using Microsoft SQL Server, go to the Microsoft SQL Server website.

Note

This example uses the Microsoft SQL Server Management Studio utility. This utility is part of the Microsoft SQL Server software distribution. To download a stand-alone version of this utility, go to the Microsoft Download Center - Microsoft SQL Server Management Studio Express.

Microsoft SQL Server Management Studio

To connect to a DB Instance using Microsoft SQL Server Management Studio

  1. Find the DNS name for your DB Instance

    1. On the My DB Instances page of the AWS management Console, select the check box next to the DB Instance running the Microsoft SQL Server database engine.

      Locate DB Instance endpoint and port
    2. On the Description tab of the lower panel, note the endpoint of the DB Instance to use in the next step.

    3. On the Description tab of the lower panel, note the port of the DB Instance to use in the next step.

  2. Run Microsoft SQL Server Management Studio.

  3. The Connect to Server dialog box appears.

    Connect to Server dialog
  4. In the Server type: drop-down list box, select Database Engine.

  5. In the Server name: text field, enter or paste the endpoint of the DB Instance running the Microsoft SQL Server database engine, followed by a comma and then the port number of the DB Instance. For example, the Server name could be: sqlsvr-pdz.c6c8mdfntzgv0.us-west-2.rds.amazonaws.com,1433.

  6. From the Authentication drop-down list box, select SQL Server Authentication.

  7. Enter the master user name for the DB Instance in the Login: text box.

  8. Enter the password for the master user in the Password: text box.

  9. Click the Connect button.

    After a few moments, Microsoft SQL Server Management Studio should be connected to your DB Instance.

  10. Click the New Query button at the top left of the SQL Server Management Studio window.

    A new SQL Query window will open.

    SQL Query Window
  11. Type the following SQL query:

    select @@VERSION
  12. Click the ! Execute button on the SQL Enterprise Manager toolbar to run the query.

    You should see a version string returned from your Microsoft SQL Server DB Instance displayed in the output window.

    SQL Query results

Troubleshooting a Connection to a DB Instance Running SQL Server

There are two common causes for problems if you are having problems connecting to a SQL Server DB instance: the access rules enforced by your firewall and the IP addresses you authorized to access the DB instance in the DB security group (or VPC security group if your DB instance is inside a VPC). If you used Microsoft SQL Server Management Studio and you followed the settings specified in the steps above and you are unable to connect, the problem is most likely the egress or ingress rules on your firewall. If you cannot send out or receive communications over the port you specified when you created the DB instance, you will not be able to connect to the DB instance. Check with your network administrator to determine if the port you specified for your DB instance is allowed to be used for inbound and outbound communication.

Here are a few things to check if you know that you can send and receive communications through your firewall for the port you specified when you created the DB instance.

  • Could not open a connection to SQL Server - Microsoft SQL Server, Error: 53 - You must include the port number when you specify the Server Name when using Microsoft SQL Server Management Studio. For example, the server name for a DB instance (including the port number) could be: sqlsvr-pdz.c6c8mdfntzgv0.us-west-2.rds.amazonaws.com,1433.

  • No connection could be made because the target machine actively refused it - Microsoft SQL Server, Error: 10061 - You were able to reach the DB instance but the connection was refused. This is often caused by the user name or password being incorrect.