Wednesday, May 18, 2011

SQL Azure

Moving the database to the cloud was trivial. Everything behavous more or less the same from Visual Studio and SQL Server Management Studio. I have discovered a few odd issues. I guess most of them actually are related to the the Management Studio, not the database in the cloud.

For instance if you create a table, the designer are not available yet. So you stick with T-SQL statements. If you right click on the table, and select “Script table as –> Create to –> New query editor window” you could end up with a script like this:

CREATE TABLE [dbo].[Person2](
[Id] [
int] IDENTITY(1,1) NOT NULL,
[FirstName] [varchar](
50) NOT NULL,
[LastName] [varchar](
50) NOT NULL,
[BornDate] [date] NOT NULL,
[AddressLine1] [varchar](
50) NULL,
[AddressLine2] [varchar](
50) NULL,
[PostalCodeNumber] [varchar](
4) NULL,
[PostalCodeName] [varchar](
50) NULL,
[Gender] [varchar](
10) NOT NULL,
[Received] [date] NULL,
[DeadDate] [date] NULL,
[ReservationCode] [varchar](
3) NULL,
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX
= OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)


And if you try to run this, you will actually end up with an error message




Keyword or statement option 'pad_index' is not supported in this version of SQL Server.



Remove the part WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) and everything works just fine.



The statement “SELECT *  FROM [MyCloud].[dbo].[Person]” from Management Studio works just fine if the correct databaseimage is selected in the upper left corner. But if you disconnect and reconnect, the default database ‘master’ is selected. And eventhough the select statement has the [MyCloud] database spesified, you will get the error “Reference to database and/or server name in 'MyCloud.dbo.Person' is not supported in this version of SQL Server.” Which is kind of confusion.

1 comment:

  1. A Beginner's Guide to Casino Games - Casino Sites
    No matter what type of casino game 바카라사이트 you're betting on, you'll always find a good chance of winning big. Here are everything you 우리카지노 need to start

    ReplyDelete