MSSQL Function Error) 'xxx'은(는) 인식할 수 없는 함수 이름입니다. / Cannot find either column "dbo" or the user-defined function or aggregate "dbo.xxx", or the name is ambiguous.

반응형

 

 

  • 예시 함수
create function fn_test()
returns
	nchar(15)
as
begin
	return 'hello word!'
end

 

인식할 수 없는 함수 이름 Error)

Msg 195, Level 15, State 10, Line 171
'xxx'은(는) 인식할 수 없는 함수 이름입니다.


해결 방법)

함수명 확인

  • 함수의 이름이 잘못되었는지 확인 후 제대로 된 함수명 입력

함수 앞에 dbo 명시

  • 함수의 앞에 dbo 명시
  • dbo.함수명
-- function call
select dbo.functionName()

dbo 이름 모호함 Error)

Cannot find either column "dbo" or the user-defined function or aggregate "dbo.xxx", or the name is ambiguous.

 

함수 실행은 이상없이 잘 되지만 계속 빨간줄이 뜨며 뭔가 보기 불편하다.


해결 방법)

함수 실행 권한 추가

  • (객체 탐색기에서) Databases - DB - Programmability - Functions - 선언한 함수의 종류 폴더 선택
  • 해당 함수 우클릭 - Properties

 

  • Permissions - Search

 

  • Browse

 

  • [guest] 체크 - OK

 

  • OK

 

  • Explicit 탭 - Execute - Grant 체크 - OK

 

  • 빨간줄 사라짐


퍼블릭 유저 실행 권한 추가

GRANT EXECUTE TO public

 

반응형