Syntax error

  • hi ..Can anyone tell me what is the error here. I tried closing the table and adding but it still give errors 🙁

    CREATE TABLE [Comp].[Model](
      [Model] [nvarchar](255) NOT NULL,
        [ModelCondition] [nvarchar](100) NULL )
    WITH (DATA_COMPRESSION = PAGE) ON [Comp]

  • komal145 - Monday, May 15, 2017 9:15 AM

    .Can anyone tell me what is the error here.

    SQL Server probably can.  What is the error message?

    John

  • Hi Komal,

    Please try putting the ON clause before WITH clause. So it might look like
    CREATE TABLE [Comp].[Model](
    [Model] [nvarchar](255) NOT NULL,
      [ModelCondition] [nvarchar](100) NULL ) ON [Comp]
    WITH (DATA_COMPRESSION = PAGE)          

    Please check and let us know.

    Thanks.

  • thank you it works.

  • komal145 - Monday, May 15, 2017 9:15 AM

    hi ..Can anyone tell me what is the error here. I tried closing the table and adding but it still give errors 🙁

    CREATE TABLE [Comp].[Model](
      [Model] [nvarchar](255) NOT NULL,
        [ModelCondition] [nvarchar](100) NULL )
    WITH (DATA_COMPRESSION = PAGE) ON [Comp]

    You have the clauses inverted.

    CREATE TABLE [Comp].[Model](
    [Model] [nvarchar](255) NOT NULL,
    [ModelCondition] [nvarchar](100) NULL )
    ON [Comp] WITH (DATA_COMPRESSION = PAGE)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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

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