Problem : 

While trying to create a new table in sql server database associate with my Azure account, i got below error :

'Filegroup reference and partitioning scheme' is not supported in this version of SQL Server.

The query was :

/****** Object:  Table [dbo].[Country]    Script Date: 3/31/2014 6:18:18 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Country](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](100) NOT NULL,
[AllowsBilling] [bit] NOT NULL,
[AllowsShipping] [bit] NOT NULL,
[TwoLetterIsoCode] [nvarchar](2) NULL,
[ThreeLetterIsoCode] [nvarchar](3) NULL,
[NumericIsoCode] [int] NOT NULL,
[SubjectToVat] [bit] NOT NULL,
[Published] [bit] NOT NULL,
[DisplayOrder] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

Note : I tried to run a T-Sql Query copied from my old database.

Solution:

To make it work with Azure we need to remove the all occurrence of ON [PRIMARY] for above create statement, and it will execute fine without error. So the new query will be :

USE [DellStoreDb]
GO

/****** Object:  Table [dbo].[Country]    Script Date: 3/31/2014 6:18:18 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Country](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](100) NOT NULL,
[AllowsBilling] [bit] NOT NULL,
[AllowsShipping] [bit] NOT NULL,
[TwoLetterIsoCode] [nvarchar](2) NULL,
[ThreeLetterIsoCode] [nvarchar](3) NULL,
[NumericIsoCode] [int] NOT NULL,
[SubjectToVat] [bit] NOT NULL,
[Published] [bit] NOT NULL,
[DisplayOrder] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) 

GO






Comments (10) -

  • Sipke

    7/8/2014 10:18:39 PM |

    Just what I was looking for. Thanks!

  • Miguel Asael

    8/16/2014 5:04:13 PM |

    Muchas gracias tío, me ha sido de gran ayuda!

  • Miguel Asael

    8/16/2014 5:04:55 PM |

    Thanks a lot my friend, it was very helpful for me!

  • kashave kumar

    4/12/2015 8:18:22 PM |

    very usefull
    thanks a lot

  • vishwajeet

    5/5/2015 10:30:41 AM |

    very usefull
    thanks a lot

  • boomanshu

    6/28/2015 12:34:23 AM |

    Perfect thanks much. Just what I needed.

  • Sayeed

    7/24/2015 12:39:11 PM |

    Thanks! Exactly what the doctor had ordered!

  • Akshay

    8/7/2015 9:22:17 PM |

    Thanks. Did not think this was the issue.

  • Kangry

    10/20/2015 3:02:36 AM |

    thx.

  • Guru Mulinti

    6/23/2016 1:40:57 AM |

    Super.. Thanks a lot .. it worked for me..

Loading