Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

Guidelines for Connecting to Azure SQL Database Programmatically

Updated: December 10, 2014

Microsoft Azure SQL Database works with third-party applications, open source, and many familiar Microsoft applications, such as WCF Data Services, ODBC, and ADO.NET. This article contains general guidelines for connecting to Azure SQL Database using these technologies. For specific information about connecting using SQL Server Management Studio, see Managing Azure SQL Database using SQL Server Management Studio.

The following table contains general guidelines for connecting to Azure SQL Database:

 

Connection points Guideline

Ports

The Azure SQL Database service is only available with TCP port 1433. To access Azure SQL Database from your computer, ensure that your firewall allows outgoing TCP communication on TCP port 1433.

Firewalls

Before you can connect to your Azure SQL Database server for the first time, you must use the Azure Platform Management Portal to configure the Azure SQL Database firewall. You will need to create a server-level firewall setting that enables connection attempts from your computer or Azure to the Azure SQL Database server. Further, if you want to control access at the database level in your Azure SQL Database server, you must create database-level firewall rules for those databases. For more information, see Azure SQL Database Firewall, How to: Configure Firewall Settings (Azure SQL Database), and Azure SQL Database Security Guidelines and Limitations.

Connection strings

Because some tools implement tabular data stream (TDS) differently, you may need to append the Azure SQL Database server name to the login in the connection string using the <login>@<server> notation. In these cases, separate the login and Azure SQL Database server name with the @ symbol. For example, if your login was named login1 and the fully qualified name of your Azure SQL Database server is servername.database.windows.net, the username parameter of your connection string should be: login1@servername. This restriction places limitations on the text you can choose for the login name. For more information, see CREATE LOGIN (Transact-SQL).

If you do not specify a database in the connection string, you will be connected to the master database.

Transact-SQL statements

Not all embedded Transact-SQL statements are supported by Azure SQL Database. Some statements that are supported in Azure SQL Database may not support all of the same optional parameters as SQL Server. For more information about Transact-SQL support in Azure SQL Database, see Azure SQL Database Transact-SQL Reference.

The Transact-SQL USE command is not currently supported for switching between databases. Establish a connection directly to the target database.

Databases

You must connect to the master database to create logins and databases. The master database also has the sys.sql_logins and sys.databases views that you can use to view logins and databases, respectively. For more information, see Managing Databases and Logins in Azure SQL Database.

It's also good to know what's not supported when it comes to connecting to Azure SQL Database. The following is a list of technologies not supported when connecting to Azure SQL Database:

  • Windows Authentication. Use SQL Server authentication in your connection string instead.

  • OLE DB. However, you can connect to a SQL Server linked server with an application written with SQL Server Native Client OLE DB.

  • Distributed transactions. For more information, see Azure SQL Database General Guidelines and Limitations.

Also, be advised that Azure SQL Database provides its large-scale multi-tenant database service on shared resources. In order to provide availability to all Azure SQL Database customers, your connection to the service may be closed due throttling or worker thread compliancy limits. For more information, see the Windows Azure SQL Database Connection Management article in the TechNet Wiki.

See Also

Visa:
© 2014 Microsoft