>>I'm using SQL Server 7.0. I restored a database from a backup, and for this database, when I try to: - select top 10 * from sysindexes. The SQL returns an error '10' is not a valid entry.
>
>Just a wild guess, cause I never really looked how SQL Server does this (VFP doesn't cause errors on these): could it be that there are more than 10 records tied for first and choosing the top 10 would cause an error? Or that less than 10 records qualify to be in the result?
Couple of things... you really only need to state "select top 10 from ..." and exclude the asterisk. However, are you doing this via SQLEXEC or are you setting up a remote view with this select statement? My experience has been that remote views don't like "SELECT TOP" and in fact if you look at the view designer while you are creating a remote view, the "top" option is not even available on the Misc tab. Does anybody know why this is? If you try to programmatically create this select via "CREATE SQL VIEW xxx REMOTE AS ..." you would get an ODBC error back "Incorrect syntax near 10". I have not reported this to Microsoft .... yet. I am using VFP SP4 and the most recent SQL server driver.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only