Error on TOP clause

  • On a 2K server (sp1) I am recieving a syntax error when using the TOP clause in a select. For example, "Select TOP 100 Percent * from ANYTABLE" gives a syntax error at 100.

    This happens when trying to create views in EM and T-SQL.

    If you try to open the table in EM the Return Rows option is greyed out.

    I know the server should be upped to the latest sp but this was not the behaviour a month ago.

    Anyone seen this before ?

    Cheers all,

    DB


    The systems fine with no users loggged in. Can we keep it that way ?br>

  • Check the compatibility level of the database:

    exec sp_dbcmptlevel YourDBName

    It needs to return 7.0 or greater, otherwise TOP isn't available.

     

  • Brill !

    Got it in one - sp returns 65, which makes sense as it is a dinosaur database.

    thanks,

    DB


    The systems fine with no users loggged in. Can we keep it that way ?br>

  • >>it is a dinosaur database

    Sqlsaurus Rex ?

  • Any reasons why you are still on SP1 ?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • It's about to be vaporised, like the dinosaurs and the meteor - if you subscibe to that theory.

    No other reason.

    DB


    The systems fine with no users loggged in. Can we keep it that way ?br>

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

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