create table statement error

  • Hi

    when I run the following statement in the query analyser, I get an error :

    [Microsoft][ODBC SQL Server Driver]Syntax error or access violation

    here is the statement :

    CREATE TABLE [dbo].[tblGroups] {

     drgrpid int IDENTITY (1, 1) 

                     PRIMARY KEY  CLUSTERED ,

     drgroup varchar (100)  NOT NULL ,

     drlongcode varchar (100)  NOT NULL ,

            drattr_1 varchar (50)  NOT NULL ,

            drattr_2 varchar (50)  NOT NULL  }

    any ideas as to why this is happening ?

    thanks

  • Replace the brackets with parenthesis

    /hm

  • thanks !

  •  

    or replace {}  with ()

    CREATE TABLE [dbo].[tblGroups] (

     drgrpid int IDENTITY (1, 1) 

                     PRIMARY KEY  CLUSTERED ,

     drgroup varchar (100)  NOT NULL ,

     drlongcode varchar (100)  NOT NULL ,

            drattr_1 varchar (50)  NOT NULL ,

            drattr_2 varchar (50)  NOT NULL  )

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply