why can't I...

Results 1 to 8 of 8

Thread: why can't I...

  1. #1
    Join Date
    Dec 1969
    Posts
    168

    Default why can't I...

    SELECT TOP 1 FROM Products --- "Incorrect Syntax Near &#039;1&#039;"<BR>SELECT TOP 10 FROM Products --- "Incorrect Syntax Near &#039;10&#039;"<BR>Also, &#039;Return Top...&#039; under &#039;Open Table&#039; in Enterprise Manager.<BR><BR>What gives???<BR><BR>Thanks in advance for any help.

  2. #2
    Join Date
    Dec 1969
    Posts
    11,334

    Default Ya need to specifiy a field

    SELECT TOP 10 * FROM ...<BR><BR>or<BR><BR>SELECT TOP 10 FieldName FROM ....

  3. #3
    Join Date
    Dec 1969
    Posts
    168

    Default RE: Ya need to specifiy a field

    Oh yeah, that was a typo in that first post...<BR>SELECT TOP 1 * FROM Products -- "Incorrect Syntax near &#039;1&#039;"

  4. #4
    Join Date
    Dec 1969
    Posts
    11,334

    Default Syntax looks correct

    What database are you using? Perhaps the db doesn&#039;t support it.<BR><BR>Offhand, I don&#039;t think MySQL or Access supports that, but I could be wrong (as usual).


  5. #5
    Join Date
    Dec 1969
    Posts
    168

    Default SQL Server 2000

    SQL Server 2000

  6. #6
    Join Date
    Dec 1969
    Posts
    11,334

    Default BTSOM then

    Cause that syntax looks correct...<BR><BR>How about posting more of the code? Maybe something stands out then.

  7. #7
    Join Date
    Dec 1969
    Posts
    168

    Default Thanks anyhow

    Dunno what I should search for on msdn either :p

  8. #8
    Join Date
    Dec 1969
    Posts
    2,437

    Default RE: Thanks anyhow

    At what compatibility level are you running? If it is 6.5 or lower TOP will not function<BR><BR>http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q233508&

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •