Include fields from a table function in a select 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
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