Connecting to the Server

Microsoft SQL Azure Database works with third-party applications, open source, and many familiar Microsoft applications, such as ADO.NET Data Services, ODBC, and ADO.NET. This section describes how to connect to your SQL Azure server with some technologies that are enabled in this release.

Considerations for Connecting to SQL Azure

The following considerations apply for any connection to SQL Azure.

  • The SQL Azure Database service is only available with TCP port 1433. To access a SQL Azure database from your computer, ensure that your firewall allows outgoing TCP communication on TCP port 1433.
  • Before you can connect to your SQL Azure server for the first time, you must use the SQL Azure portal to configure the SQL Azure firewall. You will need to create a firewall setting that enables connection attempts from your computer or Windows Azure. For more information, see How to: Configure the SQL Azure Firewall and SQL Azure Firewall.
  • Because some tools implement tabular data stream (TDS) differently, you may need to append the SQL Azure server name to the login in the connection string using the <login>@<server> notation. In these cases, separate the login and SQL Azure server name with the @ symbol. For example, if your login was named login1 and the fully qualified name of your SQL Azure 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 (SQL Azure Database).
  • If you do not specify a database in the connection string, you will be connected to the master database.
  • The Transact-SQL USE command is not currently supported for switching between databases. Establish a connection directly to the target database.
  • Not all embedded Transact-SQL statements are supported by SQL Azure. Some statements that are supported in SQL Azure may not support all of the same optional parameters as SQL Server 2008. For more information about Transact-SQL support in SQL Azure, see Transact-SQL Support (SQL Azure Database).
  • 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 SQL Azure.
  • SQL Azure does not support Windows Authentication. Use SQL Server authentication in your connection string.
  • Connecting to SQL Azure by using OLE DB is not supported.
  • SQL Azure does not support distributed transactions, which are transactions that affect several resources. For more information, see Guidelines and Limitations (SQL Azure Database).
In This Section

Topic Description

How to: Connect to SQL Azure Using sqlcmd

Shows how to connect to SQL Azure by using the sqlcmd utility.

How to: Connect to SQL Azure Using ADO.NET

Shows how to develop an application against SQL Azure by using ADO.NET.

How to: Connect to SQL Azure Through ASP.NET

Shows how to connect to SQL Azure by using ASP.NET in a Windows Azure Web Role.

How to: Connect to SQL Azure Through ADO.NET Data Services

Shows how to connect to SQL Azure through a data service.

See Also

Concepts

Guidelines and Limitations (SQL Azure Database)
Developer's Guide (SQL Azure Database)

>
Page view tracker