1

I'm running this query on SQL Server 2008 R2:

SELECT 
   orr.Rate, orr.ID, orr.UserKey, fn.NetRate 
FROM 
   OngoingRate orr 
CROSS APPLY 
   dbo.GetRateNetView(orr.UserKey) as fn
WHERE 
   orr.UserKey = 5

I get the following error:

Incorrect syntax near '.'.

Please help

marc_s
  • 9,052
  • 6
  • 46
  • 52
Vuzi
  • 19
  • 1

1 Answers1

7

The syntax you have is correct from SQL Server 2005 and up. You are using SQL Server 2008 so it should work just fine unless you have compatibility level for your database set to "SQL Server 2000 (80)".

Make sure you have compatibility level set to at least "SQL Server 2005 (90)".

Right-click on your database - Properties - Options

enter image description here

Mikael Eriksson
  • 22,295
  • 5
  • 63
  • 106