Database Reference
In-Depth Information
SQL Azure only supports SQL Server authentication. Windows Authentication isn't
supported.
When connecting to SQL Azure, you must specify the target database in the
connection string. Otherwise, you're connecting to the master database.
Distributed transactions (transactions that affect multiple resources, such as
tables, or different databases via sharding) aren't supported in SQL Azure.
You must ensure that your SQL Azure firewall is configured to accept connections.
You must determine whether any embedded (in-line) T-SQL in your application is
supported by SQL Azure.
You must use the login name format < login >@< server > when connecting to SQL
Azure, because some tools implement Tabular Data Stream (TDS) differently.
Most of the items in this list are self-explanatory, but let's talk about a couple of them. First, it's
highly recommended that you read Appendix B, which discusses the T-SQL syntax that is and isn't
supported. Also, if you have any inline or embedded T-SQL code, you need to go through your app and
make sure the T-SQL meets the requirements listed in Appendix B. It also may behoove you look at the
online help for supported T-SQL syntax, because of the gap between when this topic is finished and
when it's published (Microsoft may make some T-SQL changes in that time).
Second, although distributed transactions aren't supported, Chapter 10 discusses a technique called sharding
that you can use to improve performance dramatically. Sharding is the concept of horizontally partitioning your
data among several databases based on criteria (such as geolocation) and then using a technology such as the
ADO.NET Task Parallel Library (TPL) to add parallelism and concurrency to your application.
Third, think carefully about OLE DB. SQL Azure currently doesn't support connecting via OLE DB,
but supporting OLE DB is on Microsoft's radar. However, as you learned in Chapter 3, you can connect
using OLE DB using SSIS. It isn't recommended, though, that you try to work in OLE DB—wait until it's
fully supported.
Let's get to some coding. The next few sections show you how to connect to SQL Azure using different
libraries such as ADO.NET, ODBC, the sqlcmd utility, and WCF Data Services to query SQL Azure.
ADO.NET
Microsoft makes it very easy to connect an application to SQL Azure by providing the necessary
connection strings for both ADO.NET and ODBC, as shown in Figure 6-1. You can find the connection
information on the SQL Azure Server Administration page by selecting a database and clicking the
Connection Strings button.
Figure 6-1. Connection strings
Search WWH ::




Custom Search