MS SQL Server does not create tables in a specified filegroup I have three filegroups in my database:



Default is TERTIARY. Now I want to create table on PRIMARY and it shows the following error


  Incorrect syntax near the keyword 'primary'.


create table tb1
(
    id int identity primary key nonclustered,
    somecolumn nvarchar(15)
)
on PRIMARY;


When I change the default filegroup option to PRIMARY it lets to create tables on PRIMARY. 
Why does it show this error when my syntax is not wrong?

Thanks for your time.
I think your problem stems from the fact that PRIMARY is a reserved word.  There are several options for the ON clause of a CREATE TABLE statement and putting square brackets around the word [PRIMARY] eliminates confusion about what you are actually asking SQL Server to do.