You are on page 1of 22

Managing SQL Azure Accounts and Databases

SQL Azure is the SQL Server teams name for a set of highly scalable cloud services based on a customized version of SQL Server 2008 and related services hosted in Microsoft data centers. SQL Azure is intended to provide the capabilities of an enterprise-grade data center without the capital cost of its physical facilities or the operating expenses for its management or maintenance, as well as server and database license fees. SQL Azure provides high availability by replicating a total of three redundant copies of your data to separate physical servers. SQL Azure achieves scalability while maintaining transactional consistency by partitioning data into individual 10GB or smaller databases. When this chapter was updated in January 2010, only the rst of these services SQL Azure Database (SADB) v1, a scalable and available relational database had been released as a commercial product. Ultimately, SQL Azure will consist of the following services: SQL Azure Database to provide core SQL Server database capabilities (released during PDC 2009). Azure Data Sync to enable synchronizing cloud and on-premises SQL Server and SQL Azure databases with the Microsoft Sync Framework. Chapter 13 describes Azure Data Sync. Business Intelligence (BI) and Reporting Services (RS) with no current CTP or release timetable.

This chapter concentrates on creating a SQL Azure account, getting connected to an SADB v1 server, and creating user databases with SQL Server Management Studio (SSMS) 2008 R2 November 2009 CTP [Express] and the sqlcmd utility. This chapter was written after SADB released to the Web (RTW) as a commercial product with service fees. When you connect to the commercial version, the credit card you specify when creating your account will be charged US$9.99 per month for a database size up to 1GB (Web Edition) and US$99.99 per month for up to 10GB of space (Business Edition), plus US$0.10 per GB of data ingress and US$0.15 per GB of data egress.

Part IV: Working with SQL Azure Services


Microsoft offers several discounted service plans, which offer free Windows Azure compute and storage quotas; an SADB account with varying numbers of databases; as well as data ingress, egress, Service Bus Connections, and Access Control Transactions. These plans are described in the Windows Azure Pricing Info page (http://bit.ly/1TeCsu, http://www.microsoft.com/windowsazure/offers/). Registered members of Microsofts Partners Network receive additional discounts, and MSDN Premium subscribers receive substantially larger free quotas. Links on the Azure Pricing Info page lead to more information about these additional benets.

Tracking SSDSs Migration to a Relational Database


Ray Ozzie announced SQL Server Data Services (SSDS) at the MIX08 conference in Las Vegas during his March 5, 2008, keynote address. SSDS became available as a CTP later in the rst half of 2008 and provided an on-demand, pay-per-use data model, which offered the following features: A exible, schemaless entity model that lets users add new attributes to the entity type when needed; the system indexes the attributes automatically. Simplied data types for attribute values: string, numeric, datetime, boolean, and binary. REST-based and LINQ-like queries; SOAP was also supported. Plain old XML (POX) was the only wire format then available; AtomPub was promised. No projections; the unit of storage was a complete entity. Highly scalable by partitioning of sizes in the tens of GB. Secure data access with SSL, LiveID authentication, and authorization at the account (billing unit), authority (collection of containers), container (set of entity sets), and type (entity type) levels. A promise of data synchronization and bulk uploads with the Microsoft Sync platform.

For more background on the MIX08 SSDS announcement and early reaction to SSDS in the computer trade press, see the SQL Server Data Services to Deliver Entities from the Cloud post of March 7, 2008, to the OakLeaf blog (http://bit.ly/SJydJ, http://oakleafblog.blogspot.com/2008/03/ sql-server-data-services-to-deliver.html) and Spelunking SQL Server Data Services (http://bit.ly/gS7RR, http://oakleafblog.blogspot.com/2008/03/spelunking-sqlserver-data-services.html). The initial SSDS architects chose the Entity-Attribute-Value (EAV) data model implemented by a hierarchical set of Authority, Container, and Entity (ACE) objects, rather than the traditional relational data model because EAV databases could scale out to extreme sizes, typied by Googles BigTable and Yahoo!s Hadoop examples. The problem with this approach was the difculty that potential customers encountered when attempting to distinguish SSDS tables from the similar EAV tables offered by Azure Data Services. Further, the Azure marketing team was strongly promoting the benets of leveraging developers experience with .NET programming and Visual Studio to ease the burden of migrating conventional ASP.NET applications and .NET-based services from on-premises data centers to those in the cloud. Developers and their management were more interested in leveraging their relational database design and Transact-SQL (T-SQL) query skills than the potential for increased scalability. Architects and developers also had misgivings about the eventual consistency

Chapter 12: Managing SQL Azure Accounts and Databases


properties of EAV tables rather than the immediate, transactional update consistency of SQL Server clusters. On October 27, 2008, Ray Ozzie announced that Windows Azure would be the name of Microsofts new Platform as a Service (PaaS) cloud computing contender. SSDS was renamed SQL Data Services (SDS) at PDC 2008. Microsofts marketing folks are well known for listening intently to their users, including millions of developers, and acting on user feedback. The SSDS team nally understood the error of their EAV approach about one year later and announced a mid-course correction to their SSDS plans on March 10, 2009. Also on that day, David Robinson, this books technical editor, added The no spin details on the new SDS features post (http://bit.ly/AW3Jm, http://blogs.msdn.com/ssds/archive/2009/03/10/9469228.aspx) to whats now the SQL Azure Team Blog: Today we announced the details of our plans to accelerate the delivery of core relational database features as part of SDS. There has been quite a bit of buzz about SDS over the past couple weeks and it is great to be able to share the details more broadly. If we ash back about a year ago to Mix 08, Nigel Ellis got up on stage to introduce the community to SDS which, at the time, was a exible entity based cloud database that you accessed using standard internet protocols. We made this announcement with the promise that more relational capabilities would be coming and they did. But the universal feedback we received from our TAP partners and other early adopters was the need for a relational database delivered as a service. This was extremely valuable feedback and drove us to more aggressively investigate ways in which we could deliver these features. As a result of that work and based on the progress weve since made in the product team, we are announcing that SDS will deliver full relational database capabilities as a service. The SDS team changed its name and rebranded the service to SQL Azure on July 9, 2009. For additional details about SDSs change from the EAV to relational data model, see the February 24, 2009, A Mid-Course Correction for SQL Data Services (http://bit.ly/85YOa,
http://oakleafblog.blogspot.com/2009/02/mid-course-correction-for-sql-data.html) and the March 10, 2009, SQL Data Services Abandons REST for TDS API and Knocks My Socks Off (http://bit.ly/gWgyB, http://oakleafblog.blogspot.com/2009/03/sql-data-servicesabandons-rest-for-tds.html) posts.

Reviewing Current SQL Azure Database Documentation and Resources


MSDNs SQL Azure Database documentation, which is available online at http://bit.ly/12N3Mp, http://msdn.microsoft.com/en-us/library/ee336279.aspx, contains the following chapters: Introducing SQL Azure Database SQL Azure Database Concepts

Part IV: Working with SQL Azure Services


Developers Guide Guidelines and Limitations Transact-SQL Reference SQL Azure Database Copyright and Legal Information

The Transact-SQL Reference chapter is especially useful because it contains lists of supported, partially supported, and unsupported T-SQL reserved words. The Windows Azure team released the Windows Azure Platform Training KitDecember [2009] Update for downloading on December 23, 2009, at http://bit.ly/3Nwdbn, http://www.microsoft.com/ downloads/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78&displaylang=en . The kit offers the following SQL Azure Databasespecic elements in .pptx, .docx, or .htm format: Presentations What is SQL Azure? Introduction to SQL Azure Building Applications using SQL Azure Scaling Out with SQL Azure

Demonstrations Preparing Your SQL Azure Account Connecting to SQL Azure Managing Logins and Security in SQL Azure Creating Objects in SQL Azure Migrating a Database Schema to SQL Azure Moving Data Into and Out Of SQL Azure using SSIS Building a Simple SQL Azure App Scaling Out SQL Azure with Database Sharding

Hands On Labs Migrating Applications to Windows Azure Introduction to SQL Azure Migrating Databases to SQL Azure

Demonstrations and Hands-On Labs require a sample database, so you must have a commercial SQL Azure account in which to create the database. You can nd the SQL Azure Getting Started forum at http://bit.ly/ARCwN, http://social.msdn. microsoft.com/forums/en-US/ssdsgetstarted/threads/.

Chapter 12: Managing SQL Azure Accounts and Databases

Creating or Upgrading Windows Azure and SQL Azure Accounts


The Windows Azure Platform team designated January 4, 2010, as the date for commercial release of Windows Azure, SADB, and Azure AppFabric with the following announcements: Windows Azure Team blog (http://bit.ly/6HsovV, http://blogs.msdn.com/windowsazure/
archive/2010/01/04/sign-up-for-a-windows-azure-platform-offer-today-and-getvisibility-into-your-usage.aspx)

SQL Azure Team blog (http://bit.ly/61OS6H, http://blogs.msdn.com/ssds/archive/2010/ 01/04/9943474.aspx) Windows Azure Platform AppFabric Team Blog (http://bit.ly/6a9xuS, http://blogs.msdn.
com/netservices/archive/2010/01/04/announcing-windows-azure-platform-commercialoffer-availability-and-updated-appfabric-pricing.aspx)

The following procedure will create new commercial Windows Azure, SADB, and Azure AppFabric (formerly .NET Services) accounts with the Windows Live ID, or if you use the Live ID account with which you created free CTP accounts, it will upgrade the CTP accounts and their projects to commercial status. The procedure and screen captures that follow are based on the OakLeaf Blogs How to Create and Activate a New Windows Azure and SQL Azure Account or Upgrade an Existing Account post of 1/5/2010 (http://bit.ly/4riEfv, http://oakleafblog.blogspot.com/2010/01/how-to-create-andactivate-introductory.html).

1.

Log in to the Windows Azure Development Portals SQL Azure Project Viewer page (http://bit.ly/4riEfv, https://sql.azure.com/ProjectViewer.aspx) with your Windows Live ID, and click the Billing link at its upper-right corner (see Figure 12-1) to open the Microsoft Online Services Customer Portal (MOCP) landing page.

Figure 12-1: The Billing link of the SQL Azure Project Viewer page. Alternatively, browse directly to the MOCP landing page (http://bit.ly/nPKPg, https://mocp.microsoftonline.com/site/default.aspx) and click Continue to open the Getting Started page (see Figure 12-2).

2. 3.

If you arent signed in, click the Sign In link, and sign in with your Windows Live ID. If youre creating a new account, you must complete Contact Information, Company Information, and Service Usage Address forms. Click the Services tab and click the Windows Azure Platform link (see Figure 12-3).

Part IV: Working with SQL Azure Services

Figure 12-2: The Microsoft Online Services Customer Portals Getting Started page.

Figure 12-3: The Services tab for Applying the Windows Azure Platform lter.

4. 5.

Click any Rate Plan link to open a Pricing Info page (see Figure 12-4). If you dont qualify for a Partner Network discount or MSDN Premium special offer, click the Buy button for one of the three free or paid accounts, complete, and skip to step 8. (The Windows Azure Platform Introductory Special offers very limited compute hours and small storage quotas at no charge. The two paid plans require agreement to a six-month subscription duration.)

Chapter 12: Managing SQL Azure Accounts and Databases

Figure 12-4: One of Windows/SQL Azures four Pricing Info pages.

6.

If you have an MSDN Premium subscription, click the Special Offers for MSDN Windows Azure Platform Benets link to open the Windows Azure Platform Benets for MSDN Subscribers page (see Figure 12-5).

Figure 12-5: This page explains temporary discounts offered to MSDN subscribers.

7. 8.

Scroll to the grid at the bottom of the page to learn details of the introductory benet plan for the rst eight months and three levels of ongoing plans when the introductory plan expires. Click the My Account link to open the My Account page (see Figure 12-6).

Part IV: Working with SQL Azure Services

Figure 12-6: The My Account page conrms your MSDN subscription and presents a Windows Azure Platform link.

9.

Click the Windows Azure Platform link to open the MOCP Subscriptions Shopping Cart page, which has the Windows Azure Platform MSDN subscription details added where appropriate MSDN Premium for this example (see Figure 12-7).

Figure 12-7: The Shopping Cart pages Billing Information pane indicates the MSDN benet appropriate for your subscription level.

Chapter 12: Managing SQL Azure Accounts and Databases


10.
Select the check box to acknowledge that you will be billed for usage over the allotment. According to a post in the Windows Azure Platform, Web Hosting, and Web Services blog, you will be notied at your Windows Live ID e-mail when you reach 75 percent of your nocharge quotas.

11.

Click Checkout, provide your credit card data, if requested, and complete the transaction to open the Review and Conrm Order page (see Figure 12-8).

Figure 12-8: The Shopping Cart pane summarizes your subscription data.

12.

Click Conrm Order to open the Things I Need To Do page, and select Activate Now in the list (see Figure 12-9).

Figure 12-9: Activate your account in MOCPs Things I Need To Do Page.

Part IV: Working with SQL Azure Services


13. 14.
If youre creating a new account, you must specify the Service Administrator name, e-mail alias, and password. When upgrading an account, the original Service Administrator credentials will be used. Click Go to activate the subscription and add the new Subscription Name, which will become the Service Name, and to display the Service Activation Summary page (see Figure 12-10).

Figure 12-10: The Service Activation Summary page lets you review the activation details, including the portals that will be affected.

15.

Click Finish to complete the activation process. In a few minutes, youll receive a conrmation message at the e-mail alias of your Live ID account (see Figure 12-11). Apparently, the MOCP team didnt receive word that .NET Services was renamed Windows App Fabric at PDC 2009, as you can see in the e-mails third bullet point.

16. 17.

Click the Developers Portals SQL Azure link to display the upgraded SQL Azure project (see Figure 12-12). If youre starting a new account with a different Windows Live ID, accept the Terms of Use to open the Create Server page, type a Server Administrator username and password, retype the password, and select the Microsoft data center to provide your database(s) from the list (see Figure 12-13). The Server Administrator for the account corresponds to SQL Servers sa login. When this chapter was updated, only South Central U.S. (San Antonio, TX), North Europe (Dublin), and Southeast Asia (Singapore) data centers supported SQL Azure accounts. Support for SQL Azure by additional Microsoft data centers in the U.S. and Europe is expected in early 2010. To prevent brute force attacks from succeeding with common user names, such as SA, Admin and Root, SQL Azure prevents use of these name.

10

Chapter 12: Managing SQL Azure Accounts and Databases

Figure 12-11: A message such as this one conrms your new or upgraded Windows Azure, SQL Azure, and Windows AppFabric (formerly .NET Services) accounts.

Figure 12-12: The Windows Azure Summary page has links to your new or upgraded Windows Azure, SQL Azure, and Windows AppFabric (formerly .NET Services) accounts.

18. 19.

For a new account, click Create Server to add the new SQL Azure server to the account. This may take several minutes to complete and display the My Projects page. Click the Project Name OakLeaf Azure MSDN Subscription, for this example to open the Server Administration page, which lists the CTP databases upgraded to commercial

11

Part IV: Working with SQL Azure Services


status, if any, as well as the master database for the account, which supports a single server (see Figure 12-14.) SQL Azure doesnt charge your account for the master database. The AdventureWorksLT database shown in Figure 12-14 has only a few tables.

Figure 12-13: Supplying Server Administrator credentials and selecting a data center for the server.

Figure 12-14: Upgrading an existing SQL Azure CTP project upgrades the original databases.

12

Chapter 12: Managing SQL Azure Accounts and Databases

Setting Up the Ser ver Firewall


SQL Azure servers provide a customizable rewall to control TCP/IP access to the server based on the callers IP address. The rewall also enables or disables access to the server by Windows Azure services, such as Web and Worker roles. To enable Windows Azure services to access the new or upgraded server, open the Server Administration page by clicking the SQL Azure vertical tab, click its Firewall Settings tab and mark the Allow Microsoft Services Access to This Server check box, which adds a MicrosoftServices rule with a default IP address range from 0.0.0.0 to 0.0.0.0. This rule allows any Microsoft-hosted service to attempt to connect to the server (see Figure 12-15.)

Figure 12-15: Marking the check box enables any Microsoft-hosted service to attempt to connect to the SQL Azure server. To enable client applications to attempt to connect via the Internet to the server, click the Add Rule button to open the Add Firewall Rule form, then type a name for the rule and the range of IP addresses to accept (see Figure 12-16). The Add Firewall Rule form includes the IP address of the calling computer for reference. However, the Internet rewall is effective only for clients that have a xed IP address. Most Internet service providers (ISPs) use the Dynamic Host Conguration Protocol (DHCP) to assign IP addresses from allocated blocks to client computers. Unless you know the range of IP addresses that your ISP can assign, you must allow all incoming addresses by specifying a range from 0.0.0.0 to 255.255.255.255. Firewall settings are cached for ve minutes, so changes might not appear immediately.

Figure 12-16: Enable client applications to attempt to connect to the SQL Azure server by specifying the allowable range of IP addresses.

13

Part IV: Working with SQL Azure Services

Creating a User Database


On the My Projects page, click an item in the Project Name column to open the Server Administration page, which lets you add databases to or drop them from the server. Click Create Database to open a dialog that lets you name the user database (see Figure 12-17). The Server Administration page connects to the selected servers default master database. SQL Azure assigns a DNS-compatible name to the server. SQL Azure doesnt permit database administrators or users to add objects directly to master.

Figure 12-17: The SQL Azure Portals Server Administration page for adding or dropping user databases. Type the user database name and click Create to close the dialog, add the user database to the server, and enable the Drop Database button when you select a user database (see Figure 12-18). Alternatively, you can create or drop a user database by opening the master database in SSMS 2008 R2 [Express] and executing a CREATE DATABASE DatabaseName or DROP DATABASE DatabaseName T-SQL command. The later Connecting to SADB Master and User Databases with SSMS 2008 R2 [Express] section describes how to connect to databases with SSMS 2008 R2 [Express]. You cant connect to SQL Azure databases with SSMS 2005 [Express], and SSMS 2008 [Express]s Object Explorer doesnt display SQL Azure objects.

14

Chapter 12: Managing SQL Azure Accounts and Databases

Figure 12-18: The SQL Azure Portals Server Administration page after adding an empty Northwind user database. Clicking the Connection Strings button opens a message with ADO.NET and ODBC connection strings for the Master database that you can copy to the Clipboard:
ADO.NET Server=tcp:k8jv7gpmwb.database.windows.net;Database=master; User ID=rogerj;Password=myPassword;Trusted_Connection=False;Encrypt=True; ODBC Driver={SQL Server};Server=tcp:k8jv7gpmwb.database.windows.net;Database=master; Uid=rogerj@k8jv7gpmwb;Pwd=myPassword;Encrypt=yes;

The tcp: prex species that the connection will use SQL Servers native Tabular Data Stream (TDS) protocol over TCP port 1433. SQL Azure connections are encrypted by default; the server will terminate the connection if the client doesnt accept encryption. With a user database selected, click the Connection Strings button to open a message that contains examples of ADO.NET and ODBC connection strings for the selected user database (see Figure 12-19). Click the ADO.NET entrys Copy to Clipboard link to save the connection string for use with on-premises or Windows Azure clients.

15

Part IV: Working with SQL Azure Services

Figure 12-19: Connection strings for ADO.NET and ODBC drivers for the Northwind database.

Testing Database Connectivity


Click the Test Connectivity button in the Server Administration screen to open the Database Connectivity Test dialog, then type your Username and Password and click Connect (see Figure 12-20). You receive a Successfully connected to the database message if the test succeeds. The ability to migrate server connections from a local SQL Server 2008 [R2] [Express] instance to SADB in the cloud by simply changing the connection string is a widely publicized SADB feature.

Figure 12-20: Testing SADB connectivity.

Connecting to SADB User Databases with SSMS 2008 R2 [Express]


SSMS 2008 R2 is the most convenient tool for executing single and batched T-SQL commands to the master and user databases. The standard SSMS 2008 [Express] versions Object Browser feature isnt compatible with the SADB August 2009 CTP; youll also encounter error messages during the connection process. SADB wasnt compatible with the Server Explorer feature of Visual Studio 2008 when this chapter was updated. You need SQL Server 2005 or 2008 [Express] to emulate SADB in projects that use the Development Fabric. A standalone (Tools Only) version of SSMS 2008 R2 Express November 2009 CTP is available from http://bit.ly/2jfVw5, http://www.microsoft.com/downloads/details.aspx?FamilyID= c772467d-e45b-43e1-9208-2c7b663d7ad1&displaylang=en. SSMS 2005 [Express] doesnt work with SADB.

16

Chapter 12: Managing SQL Azure Accounts and Databases


To connect to the SADB server that you provisioned in the preceding section with SSMS 2008 versions:

1. 2. 3.

Launch SSMS 2008 R2 [Express], and click SSMSs New Query toolbar button to open the Connect to Database dialog. Accept the default Database Engine Server Type; copy the ADO.NET connection string sample to the Server Name text box, trimming the entry to the server name, including the tcp: prex; and (optionally) select the Remember Password check box. Select SQL Server Authentication in the Authentication list, and type the server administrator credentials you created in the preceding section in the Login and Password text boxes (see Figure 12-21).

Figure 12-21: Specifying SADB login parameters in the standard Connect to Server dialog.

4.

SADB doesnt support the T-SQL USE command and, therefore, requires you to specify the database to which to connect. So, click the Options >> button to expand the dialog. In the Connect to Database combo box, accept the <default>, or type master for the master database or the name of an existing user database, and select the Encrypt Connection check box (see Figure 12-22). SADB connections are encrypted with Transport Level Security (TLS) by default, but marking the Encrypt Connection check box will please your organizations data security auditors.

5.

Click Connect to open the connection and click New Query to open the Query Editor pane. Verify that the database you specied in the preceding step is active by examining the highlighted status bar. Note that the toolbars Available Databases list is disabled.

To run a test query against a system view, execute a SELECT * FROM sys.all_objects command (see Figure 12-23). To conserve resource consumption, SADB automatically closes connections after ve minutes of inactivity. To reopen a closed connection click the Connect or Change Connection buttons at the extreme left of the SQL Editor toolbar.

17

Part IV: Working with SQL Azure Services

Figure 12-22: Specifying the SADB database for an encrypted connection.

Figure 12-23: The status bar identies the connections xed database name.

Conguring the Server Firewall


SQL Azure stores rewall rules in the master databases sys.rewall_rules system view. You can retrieve details about the current set of rules in effect by logging into SSMS 2008 R2 and typing master as the Connect to Database value and executing a SELECT * FROM sys.firewall_rules query (see Figure 12-24).

18

Chapter 12: Managing SQL Azure Accounts and Databases

Figure 12-24: Executing a T-SQL query against the master database to retrieve rewall rules in effect. SQL Azure offers two system stored procedures to create or update and delete server rules by name: Run exec sp_set_firewall_rule NAllow Windows Azure,0.0.0.0,0.0.0.0 to create or update the named rule. Run exec sp_delete_firewall_rule NAllow Windows Azure to delete the named rule.

Determining Server Usage


The sys.database_usage system view lists the history of your database usage with time (date), sku (Web or Business), and quantity (number of databases in use) columns. Each change in sku or quantity adds a new row (see Figure 12-25).

Figure 12-25: Retrieving your database usage history from the servers master database.

19

Part IV: Working with SQL Azure Services

Using the sqlcmd Utility with SADB


The sqlcmd utility is an alternative to SSMS that lets you manage database connections at the command prompt. The following instruction with valid server administrator credentials typed or pasted at the Windows command prompt opens a connection to the Northwind database running on the SADB server created earlier in the chapter:
sqlcmd -S k8jv7gpmwb.database.windows.net -U rogerj@k8jv7gpmwb -P Pas$w0rd -d Northwind

The following table describes common sqlcmd command-line arguments: Argument


-? -S -U -P -d -i -o

Description Show syntax summary Server (use complete DNS name) Server administrator name in login@servername (name only) format Server administrator password User database name (default is master) Query input (T-SQL) le path\name Query output le path\name

Figure 12-26 shows the result of executing sqlcmd -?.

Figure 12-26: The Windows command prompt displaying the sqlcmd syntax summary. After connecting to SADB, executing T-SQL statements and batched queries with sqlcmd is a simple process. At the sequentially numbered #> prompt, type a valid T-SQL command, and press Enter. Type GO and press Enter to execute the preceding command(s) and reset the prompt number to 1. Type quit or exit to close the session. Figure 12-27 shows sqlcmds window after executing the SELECT name FROM sys.tables command against the Northwind database you create with SSMS and a modied version of the InstNwind.sql script in the next chapter.

20

Chapter 12: Managing SQL Azure Accounts and Databases

Figure 12-27: Using sqlcmd to display a list of table names in a sample Northwind database.

Comparing SADB with SQL Ser ver 2008 R2 Databases


SADB servers and databases are virtual objects abstracted from a customized, multi-tenant version of clustered SQL Server instances and dont correspond to individual physical server instances. Therefore, you administer databases, tables, indexes, tuning, query optimization, logins, users, and roles but not physical storage, such as servers, les, and xed disk drives. SADB automatically handles data replication and load-balancing for high availability, including transparent fail-over when a server dies. Backup is handled by data replication; restore operations after data loss or corruption are automatic. SADB blocks statements and options that attempt to directly manipulate physical resources, such as RESOURCE GOVERNOR, legroup references, and some physical server DDL statements. Attempts to set server options, such as SET ANSI_NULLS ON, generate error messages. CRL database objects, SQL Service Broker, SQL trace ags, SQL Server Proler and Database Tuning Advisor tools and utilities arent available. Deprecated data types, such as text, ntext, and image arent supported, but you can substitute varchar(max), nvarchar(max), and varbinary(max) for them, as youll see in the next chapter. SADB currently doesnt permit use of SQL Server 2008s geography and geometry spatial data types. If you need to encrypt data, you must do so in the client application; SADB doesnt support the column-level or row-level encryption introduced by SQL Server 2005 or SQL Server 2008s Transparent Data Encryption (TDE). The Transact-SQL Reference chapter of MSDNs SQL Azure documentation (http://bit.ly/15Ja0Q, http://msdn.microsoft.com/en-us/library/ee336281.aspx) includes tables that list supported, partially supported, and unsupported T-SQL statements.

Summar y
SQL Azure Database is the basic element of SQL Azure. SADB provides a highly scalable and available relational database as a public cloud computing resource running together with the Windows Azure Platform in most of Microsofts newly constructed data centers. The SADB Web Edition supports transactional-consistent databases up to 1GB in size; the Business Edition is limited to 10GB or less.

21

Part IV: Working with SQL Azure Services


SADB grew out of early adopters dissatisfaction with technical previews of SQL Server Data Services (SSDS), which offered a exible, highly scalable, schemaless Entity-Attribute-Value data model but was missing the relational features that IT groups and developers expected from a service carrying the SQL Server name. In March 2009, Microsoft announced that SSDS would morph to a fully relational version called SQL Data Services (SDS), which enable developers to leverage their data architecture and TransactSQL skills. SDS became SQL Azure Database in July 2009 and the rst SADB CTP became available to invitees on August 17, 2009. The CTP version required requesting an invitation from the Microsoft Connect site that resulted in a token, which was redeemable from the SQL Azure portal for a single server with multiple databases at no charge. The commercial version, which released on January 4, 2010, requires a credit card to cover a charge of US$9.99 per month (Web Edition) or US$99.99 per month (Business Edition), plus US$0.10 per GB of data ingress and US$0.15 per GB of data egress. Special pricing offers are available to users with MSDN Premium subscriptions and those willing to commit to a six-month subscription. SADB auto-assigns a unique DNS address to each server. SQL Server Management Studio 2008 [Express] and the sqlcmd command-line utility connect to SADB with the TCP protocol on port 1433 using SQL Servers traditional Tabular Data Stream format via encrypted transmissions. Using TDS lets developers change from connections to local SQL Server 2005 or 2008 [Express] instances for development to SADB databases in the cloud simply by changing the connection string. SSMS 2008 R2 [Express] enables fullfeatured management of SQL Azure databases. Microsoft manages SADBs physical infrastructure, such as server instances, disk drives and les, as well as backup and restore operations, so many T-SQL DDL commands arent supported. However, developers have full control over databases, tables, indexes, tuning, query optimization, logins, users, and roles. SADB doesnt support deprecated and new SQL Server 2008 spatial datatypes, nor does it offer data encryption or compression.

22

You might also like