Error creating scalar function "Invalid Object Name dbo.fnMyFunctionName'" I am using SQL Server 2008 R2. I tried creating a new scalar function. The function gets created and I see it in the list of scalar functions.

When I try to modify function, function name is underlined in red and the mouseover text says 


  Invalid Object Name 'dbo.fnGetXName'


If I write a query and try to ref any function, intellisense shows no functions after typing dbo.. It doesn't seem to matter what I name the new function, the same issue arises
Try refreshing the Intlisense cache.

Hit crtl+shft+R

From SQL Server Management Studio Keyboard Shortcuts


  Refresh local cache


Or under 


  EDIT->IntelliSense->Refresh Local Cache