Alter Column Syntax

  • On SQL Server 7 :

    ALTER TABLE dbo.EstDealDetail ALTER COLUMN FundNo SmallInt

    gives

    Incorrect syntax near 'COLUMN'

    The table and column exist and FundNo currently is TinyInt

    Help !!

  • This seems strange. It works perfectly fine for me. Has to be something else than the syntax, it's just fine. Have you tried that exact statement in QA?

    /Kenneth

  • Thanks for the response.

    Yes. Copied directly from QA. Neither I nor a couple of colleagues could see anything wrong, hence the posting.

  • Just in case of a simple typo, I edited the posted code to :

    SELECT FundNo FROM dbo.EstDealDetail

    That runs fine.

  • Would this work or produce the same error? (alter is copied from first post)

    use tempdb

    go

    create table dbo.EstDealDetail ( FundNo tinyint not null )

    go

    insert dbo.EstDealDetail select 1

    go

    ALTER TABLE dbo.EstDealDetail ALTER COLUMN FundNo SmallInt

    go

    /Kenneth

  • Gives the same error.

    I just tried it on a different server though and it worked fine!

    Both are Windows Authentication and Ive ensured that Ive got every permission in sight on the database and the table.

  • Then check the db compat level. If it's < 70 you'll see this error.

    /Kenneth

  • Brilliant !!!

    Its 6.5

    Not 'my' database so I didnt think to check.

    Many thanks for your help.

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

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