why won't TOP work??

Last Post 01 Sep 2006 01:44 AM by NYCKSQL. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
NYCKSQL
New Member
New Member

--
01 Sep 2006 01:03 AM
Hi
I have a sql statement:

select top 100 percent *
from authors

If I run this statement on database1 in query analyser, I get the following message:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '100'.

However, if i run this statement from another database:

select top 100 percent *
from database1..authors

it returns the results set correctly!?

Also, to add to the confusion, it worked yesterday running it directly on database1.

Anyone got any ideas please?
NYCKSQL
New Member
New Member

--
01 Sep 2006 01:44 AM
oops - sorry, I'm a muppet! Don't know why I posted this inteh DTS forum - sorry! I'll post again in tsql.
You are not authorized to post a reply.

Acceptable Use Policy