Help!

  • CREATE TABLE ZZDataBaseAdminLog (

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

    [ID2] [int] NOT NULL,

    [TableName] [varchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [Ilog] [int] NOT NULL,

    [Slog] [int] NOT NULL,

    [Stamp] [datetime] NOT NULL CONSTRAINT [DF_ZZDataBaseAdminLog_Stamp] DEFAULT (getdate()),

    CONSTRAINT [PK_ZZDataBaseAdminLog] PRIMARY KEY CLUSTERED ([ID] ASC)

    WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]

    According to T-SQL help there should be nothing wrong with this, but I get syntax error near '(' after Create Table ZZDataBaseAdminLog -

    using SSMS remote and Query Analyzer on the Server.

    Any help appreciated - this is driving me nuts 🙂

    Howard

  • Take out the '(' after Create Table ZZDataBaseAdminLog ???

  • I did a cut and paste of the code above, and had no issues with it.

  • The statement is valid for SQL 2005 but not for SQL 2000 due to the "WITH (IGNORE_DUP_KEY = OFF)" part. remove this part and it will work in SQL 2000 also.

  • Oh well, guess 80 compatibility mode allows some things that the actual SQL Server 2000 engine won't. It worked fine on my SQL Server 2005 system with a database in 2000 compatibility mode.

  • that was it.

    Thanks Howard.

    PS. I put a previously SS2005 database back to 2000 mode and the 2005 code worked as well.

Viewing 6 posts - 1 through 5 (of 5 total)

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