Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

   orr.Rate, orr.ID, orr.UserKey, fn.NetRate 
   OngoingRate orr 
   dbo.GetRateNetView(orr.UserKey) as fn
   orr.UserKey = 5

I get the following error:

Incorrect syntax near '.'.

Please help

share|improve this question
I've updated this answer to include this scenario as well. Still I'm not sure why you had to restart SQL Server - compatibility level changes should take place immediately. Are you 100% certain you were running the query in the context of the database where you changed the compat level? – Aaron Bertrand May 27 '14 at 16:00
Aaron Bertrand: Im Positive, it worked after the restart – Vuzi May 28 '14 at 7:28

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

share|improve this answer
I was suspecting the same thing but I updated the compatibility level to SQL Server 2008(100). Let me restart sql server(just in case) – Vuzi May 27 '14 at 14:26
Hi Mikael, it turns out I had to restart the sql server service for the changes to take effect. Thanks for your contribution – Vuzi May 27 '14 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.