CREATE TABLE Script

  • Can someone point out to me where this script is "wrong"? I get the following error:

    Msg 170, Level 15, State 1, Line 7

    Line 7: Incorrect syntax near '('.

    Here's the script:

    USE [CNRP_DEVL]

    GO

    /****** Object: Table [cnrp].[SUBJECT_AREA] Script Date: 03/25/2008 09:24:36 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [cnrp].[SUBJECT_AREA](

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

    [SUBJECT_AREA_NAME] [varchar](25) NULL,

    CONSTRAINT [PK_SUBJECT_AREA] PRIMARY KEY CLUSTERED

    (

    [SUBJECT_AREA_ID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

  • Doesn't seem to be a problem here. Are you SURE it's in this snippet of code?

    I cut and pasted it and it runs over here....

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • I find it runs ok on a database in my home office, too. I am at a client site right now trying to do this on their DB. I'm starting to suspect there is a permissions issue maybe? I created the table in the design mode in SQL, ran the same script export and it still shows errors, even though I just created the new table moments before. So, what in the DB permissions might be causing this?

    Brad

  • Any chance that there's a DDL trigger somewhere?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Not that I'm aware of...I assume that would be in the triggers for the table? Not a SQL Server expert by anymeans, but if you give me a hint where to look I'll see.

    Brad

  • Database triggers. DDL triggers can be set up to occur on creation/deletion of objects.

    BOL reference here:

    http://msdn2.microsoft.com/en-us/library/ms190989.aspx

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • I'm not sure if there are DDL triggers, but at least I have things to look into. Thanks for the input. Not my database, but I'm becoming intimately familiar with it already!

    Brad

Viewing 7 posts - 1 through 7 (of 7 total)

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