Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query top 1

Author  Topic 

chenouss
Starting Member

2 Posts

Posted - 2010-02-11 : 04:10:01
I need to make this query:

select top 1 * from table1

I use the same query for two different data base, for the first it works for the second I have this error:

SQL Server Database Error: Line 1: Incorrect syntax near '1'.

Any Idea please!!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 04:17:24
is this full query or is it part of batch?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

chenouss
Starting Member

2 Posts

Posted - 2010-02-11 : 04:30:34
this is a full query, actually, I use the same SGBD (Sql server 2000) and I change just the data base name but I haven't the same behavior !!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 04:37:11
are both db's of same compatibility level?

what does below return?

EXEC sp_dbcmptlevel 'your dbname'

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-11 : 05:49:53
Seems that DB compatibility is set to 60

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -