Click to See Complete Forum and Search --> : Incorrect Syntax when running query


jenbuh
06-17-2009, 01:43 PM
I'm trying to run this create table query but I get an incorrect syntax error near '('. This '(' is in RED below near PAD_INDEX. Any idea what I'm doing wrong?

-- Create Role Table
PRINT 'Creating Table Role'
GO
CREATE TABLE [dbo].[Role](
[Role_Id] [uniqueidentifier] NOT NULL CONSTRAINT [DF_Role_Role_Id] DEFAULT (newid()),
[Description] [varchar](50) NOT NULL,
CONSTRAINT [PK_Role] PRIMARY KEY CLUSTERED
(
[Role_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]


Thanks in advance.

b4web
06-20-2009, 12:45 PM
Are you missing a closing paren for the role?

russell
06-22-2009, 10:05 AM
there's no syntax error. what DBMS and version are you using? if that's not MSSQL 2005 or 2008, then yeah, it's a syntax error.

also, by the way, why are u using uniqueidentifier instead of an int with an identity value? this is a performance problem waiting to happen