Database Reference
In-Depth Information
The NEWSEQUENTIALID() function isn't supported in SQL Azure because there is no
CLR support in SQL Azure, and thus all CLR-based types aren't supported. The
NEWSEQUENTIALID() return value is one of those types. Also, the ENCRYPTION option
isn't supported because SQL Azure as a whole doesn't yet support encryption.
SQL Azure doesn't support heap tables. Thus, you need to change any heap table
into a clustered table by adding a clustered index. (Interestingly, if you execute
one statement at a time, you can, in fact, create a heap table. However, any inserts
into that table fail.)
A word about the final item in the list. The syntax for defining a clustered index looks like this:
CREATE TABLE [dbo].[UserDocs]
(
[UserID] [int] NOT NULL,
[DocID] [int] NOT NULL
PRIMARY KEY CLUSTERED
(
[UserID], [DocID] ASC
)
)
One of the things the SQL Azure documentation suggests, and which is listed earlier, is to set the
Convert UDDTs to Base Types property to True. This is because user-defined types aren't supported in
SQL Azure.
After you make the changes just described to your SQL script, it should look like the following:
/****** Object: Table [dbo].[Users] Script Date: 03/31/2010 23:39:20 ******/
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Users](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NULL,
[NTUserName] [nvarchar](128) NULL,
[Domain] [nvarchar](50) NOT NULL,
[Intro] [nvarchar](100) NULL,
[Title] [nvarchar](50) NOT NULL,
[State] [nvarchar](10) NOT NULL,
[Country] [nvarchar](100) NULL,
[PWD] [varbinary](100) NULL,
[rowguid] [uniqueidentifier] NULL
PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Users] ON
INSERT [dbo].[Users] ([ID], [Name], [NTUserName], [Domain], [Intro], [Title],
[State], [Country], [PWD])
Search WWH ::




Custom Search