Database Reference
In-Depth Information
Fixing the Script
Because you selected to script for SQL Server 2008, the script includes some syntax and statements that
aren't supported in SQL Azure. Figure 5-5 shows some of the errors you see if you try to run the script as
generated.
Figure 5-5. SQL Azure execution errors
Another problem is that SQL Azure doesn't support heap tables . A heap table is one without a
clustered index. SQL Azure currently supports only clustered tables.
You need to make some changes for your script to run under SQL Azure. Here's what to do:
1.
Delete all instances of SET ANSI_NULLS ON .
Delete all instances of ON [PRIMARY] .
2.
Delete all instance of PAD_INDEX = OFF as well as ALLOW_ROW_LOCKS = ON and
ALLOW_PAGE_LOCKS = ON .
3.
In the Users table, modify the rowguid column, changing DEFAULT
NEWSEQUENTIALID() to NULL .
4.
5.
In the stored procedure, remove the ENCRYPTION clause.
Add a clustered index to any heap tables.
Appendix B discusses the need for these changes in detail. For now, here's a quick explanation:
6.
ON [PRIMARY ] isn't needed because, as you learned in Chapters 1 and 2, SQL
Azure hides all hardware-specific access and information. There is no concept of
PRIMARY or file groups because disk space is handled by Microsoft, so this option
isn't required.
According to SQL Server Books Online (BOL) you can remove the entire WITH
clause that contains the table options. However, the only table options you really
need to remove are those listed in step 3 ( PAD_INDEX , ALLOW_ROW_LOCKS , and
ALLOW_PAGE_LOCKS ).
Search WWH ::




Custom Search