Sql server gives error: not recognized function name

I backed up the database on sql 200 server. I created a new database in SQL Server 2008 r2.

Now when I run the view, I get an error:

'function_name' is not a recognized function name. 

There is a function And I can run it using

  SELECT [dbo].[function_name] ( 'hjh') GO SELECT dbo.function_name('kjk') 

Why does this problem occur when it works correctly?

EDIT:

I think this may be a security issue, since the schemas owned by the user under dbo do not contain antivirus?

+6
source share
2 answers

Make sure you run it in the correct database context.

If the view is in Database2 , and the function is in Database1 , then you will need to fully qualify the function using the name of the three parts:

Database1.dbo.[Function_Name]

It is assumed that all objects in the view are in the same database as the view, unless you specify otherwise.

+13
source

Is the view in the same database as the function? If this is not the case, you need to call it as [database_name].dbo.[function_name]

+3
source

Source: https://habr.com/ru/post/905000/


All Articles