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 2005 Forums
 SQL Server Administration (2005)
 Rank() not working

Author  Topic 

junaidKhan
Starting Member

3 Posts

Posted - 2008-11-08 : 04:29:50
I created a database named php5 through SQL server Management Studio exprees. SQL server verion is exprees edition (2005).

I treid to run the following query

1. select * from
(select *, rank() over (order by orderId) as rank from orders) a
where a.rank % 10 = 0

I got this message
Msg 195, Level 15, State 10, Line 2
'rank' is not a recognized function name.

Then I treid the following
2. exec sp_dbcmptlevel 'php5', 90

error message
Msg 15416, Level 16, State 1, Procedure sp_dbcmptlevel, Line 92
Usage: sp_dbcmptlevel [dbname [, compatibilitylevel]]

Valid values of database compatibility level are 60, 65, 70, or 80.

What went wrong?, pl help me


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-08 : 04:44:30
http://msdn.microsoft.com/en-us/library/ms178653.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-08 : 04:46:33
Seems like server you're using is sql 2000. even if you create the databse through management express studio if original server to which you connect is sql 2000 you cant set it to compatibility level 90 as max compatibility in 2000 is 80. As such you cant use rank() function in your query while querying against 2000 database.
Go to Top of Page
   

- Advertisement -