SQL scrip fail to execute on Azure SQL database

Dear all,

I have a local database hosted under SQL server 2008 R2 express for which I have created sript of the database shema.
when generating the script I have set the option to generate SQL script for SQL azure.

Then when I execute the script through SMS, it fails saying that table already exist but in fact it is not.

For instance the table creation script is as follow :

/****** Object:  Table [dbo].[Vebra_PropertyFurnishedType]    Script Date: 01/22/2014 22:13:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Vebra_PropertyFurnishedType](
	[Id] [int] NOT NULL,
	[FurnishedType] [varchar](50) NULL,
 CONSTRAINT [PK_Vebra_PropertyFurnishedType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF)
)
GO

For each of my table I have such script but it fails to execute against azure db.

Any idea ?

regards

January 22nd, 2014 4:42pm

Hello,

Can you run the following statement before try to create the table?

If exists (select name from sysobjects where name = 'tablename')
drop table [tablename]
Regards,
Fanny Liu

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2014 5:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics