I recently tried some sample code from a SQL Share video and being new to T-SQL I have a question I hope someone will answer.
Here is the code sample:
create table test.Contact
(
ContactID int identity not for replication not null,
Title nvarchar(8) null,
FirstName nvarchar(50) not null,
MiddleName nvarchar(50) null,
LastName nvarchar(50) not null,
Suffix nvarchar(10) null,
EmailAddress nvarchar(50) not null,
Phone nvarchar(25) null,
AddressLine1 nvarchar(60) not null,
AddressLine2 nvarchar(60) not null,
City nvarchar(30) not null,
StateProvinceID int not null,
PostalCode nvarchar(15) not null,
constraint PK_Contact_ContactID
primary key clustered (ContactID asc)
with
(
pad_index = off,
statistics_norecompute = off,
ignore_dup_key = off,
allow_row_locks = off
)
) on [primary];
go
My question is why are the brackets needed around the "primary" keyword at the end of the statement?
I know of a couple case where brackets would be necessary such as keywords (I thought this may be why) but primary is being used as a keyword and not as an object name so I drew a blank.
Thanks in advance.