Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CREATE TABLE Error !!

Author  Topic 

dbserver2000
Starting Member

47 Posts

Posted - 2009-05-11 : 16:09:17

I am not too sure why I am getting that error !


CREATE Database Chapter5;
GO
USE Chapter5;
CREATE TABLE dbo.AuditAccess
(
AuditAccessID int IDENTITY (1,1) NOT NULL,
UserName Varchar(50) NOT NULL,
LoginTime Datetime NULL,
CONSTRAINT [PK_AuditAccess_AuditAccessID] PRIMARY KEY CLUSTERED
(
AuditAcessID
)
);

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'AuditAccess'.

Thanks,

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-05-11 : 17:14:55
Try this (fixed typo in red)
CREATE Database Chapter5;
GO
USE Chapter5;
GO
CREATE TABLE dbo.AuditAccess(
AuditAccessID int IDENTITY (1,1) NOT NULL,
UserName Varchar(50) NOT NULL,
LoginTime Datetime NULL,
CONSTRAINT [PK_AuditAccess_AuditAccessID] PRIMARY KEY CLUSTERED
(AuditAccessID)
);
Go to Top of Page

dbserver2000
Starting Member

47 Posts

Posted - 2009-05-12 : 09:53:35
I discovered this one after I posted.

Thanks
Go to Top of Page
   

- Advertisement -