Looks kind a stupid question but I have been stuck here for an hour.
I create a user defined function from Query window in SQL Server Management Studio with following statement:
CREATE FUNCTION fnTest()
RETURNS int
AS
BEGIN
return 123;
END
Function creates successfully and I can see it in SQL object browser as here:
But function isn't available for use in that database.
Interestingly when I try to Alter function by right clicking the function, function script loads with error message:
Can somebody give me an idea what I am missing here?
EDIT: It really turned to be a stupid question. There is no error in function name, script, execution or Alter script. Everything is fine. Only SQL Editor is incorrectly showing error and I was confused by the editor error message. I apologies to everybody who spent time.