Groups | Blog | Home
all groups > sql server (microsoft) > july 2005 >

sql server (microsoft) : TOP CLAUSE not working in queries and views


John Cosmas
7/30/2005 8:11:53 PM
I had to convert a database from VFP into SQL 2000. I have a primary key I
have added, plus I have properly indexed the table as well. Unfortunately,
I cannot create a query that supports the TOP clause. SQL Server keeps
returning "Incorrect syntax near '100'" The user DBO has permissions to
everything. I have created a view in another database on the same server
and it seems to respond correctly.

dbmonitor
7/31/2005 4:11:18 PM

[quoted text, click to view]

This is normally caused when you do not specify any columns in your
query
i.e.
using:
select top 100
from table

instead of:
select top 100 *
from table

--
David Rowland
Version 1.3 of DBMonitor out now!
http://dbplussoftware.com
AddThis Social Bookmark Button