Query not parsing correctly

  • I am trying to create a table with the following query:

    CREATE TABLE [dbo].[AtsDWPeriod] (

    [PERIODID] [int] IDENTITY (1, 1) NOT NULL ,

    [dtsActivityDate] [smalldatetime] NULL ,

    [intYear] [int] NULL ,

    [intQuarter] [int] NULL ,

    [intMonthNum] [int] NULL ,

    [chrMonthName] [char] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [chrMonthAbbrev] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [intWeekNum] [int] NULL ,

    [intDayNum] [int] NULL ,

    [chrDayName] [char] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [chrDayAbbrev] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [intFiscalYear] [int] NULL ,

    [intFiscalQuarter] [int] NULL ,

    [intFiscalMonthNum] [int] NULL ,

    [intFiscalWeekNum] [int] NULL ,

    [bitAcctCycleEnd] [bit] NULL ,

    [bitPublicHoliday] [bit] NULL ,

    [bitNonWorkingDay] [bit] NULL ,

    [bitSpecialWorkDay1] [bit] NULL ,

    [bitSpecialWorkDay2] [bit] NULL ,

    [dtmCreated] [datetime] NULL ,

    [chvCreator] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY]

    go

    But I keep getting this error:

    Line 7: Incorrect syntax near 'COLLATE'.

  • I assume you are using SQL2000. If so,check the compatibility level of your database. Anything lees than 80 doesn't support the COLLATE statement.

    Also, I believe COLLATE isn't supported by SQL7 or earlier.

  • What do you advice to use to replace the collate statement? Or should I do without it entirely?Kindly redit the statement as it should be. I am using SQL 7

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

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