•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 361,941 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,654 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 1115 | Replies: 2 | Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 37
Reputation:
Rep Power: 1
Solved Threads: 0
FIRST EXAMPLE--CREATE FUNCTION dbo.myFunction()
RETURNS INT
AS
BEGIN
DECLARE @myInt INT
SET @myInt = 1
RETURN @myInt
END
select dbo.myFunction() as 'Simple Number'
This Function is not returning any value,Error is coming
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.myFunction", or the name is ambiguous.
SECOND EXAMPLE--
create function dbo.add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select dbo.add1(10,20) as result
Above function is working fine,but dbo is optional IF I write the above Function without dbo
create function add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select add1(10,20) as result
Then the Function is Contructed successfully , But when I call the function usimg Select statement
Error is there--
'add1' is not a recognized built-in function name.
Plz reply whether its necessary to write owner name to prevent errors.
RETURNS INT
AS
BEGIN
DECLARE @myInt INT
SET @myInt = 1
RETURN @myInt
END
select dbo.myFunction() as 'Simple Number'
This Function is not returning any value,Error is coming
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.myFunction", or the name is ambiguous.
SECOND EXAMPLE--
create function dbo.add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select dbo.add1(10,20) as result
Above function is working fine,but dbo is optional IF I write the above Function without dbo
create function add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select add1(10,20) as result
Then the Function is Contructed successfully , But when I call the function usimg Select statement
Error is there--
'add1' is not a recognized built-in function name.
Plz reply whether its necessary to write owner name to prevent errors.
Last edited by Yogesh Sharma : Apr 8th, 2008 at 4:36 pm.
hi,
First Example is wrkg well. Then why you geting the errors Check well. And then for functions owner name is not an optional one, You must define the function name with owner name to execute it.
Shailaja
First Example is wrkg well. Then why you geting the errors Check well. And then for functions owner name is not an optional one, You must define the function name with owner name to execute it.
Shailaja
•
•
•
•
FIRST EXAMPLE--CREATE FUNCTION dbo.myFunction()
RETURNS INT
AS
BEGIN
DECLARE @myInt INT
SET @myInt = 1
RETURN @myInt
END
select dbo.myFunction() as 'Simple Number'
This Function is not returning any value,Error is coming
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.myFunction", or the name is ambiguous.
SECOND EXAMPLE--
create function dbo.add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select dbo.add1(10,20) as result
Above function is working fine,but dbo is optional IF I write the above Function without dbo
create function add1(@num1 Int,@num2 Int)
Returns INT
as
Begin
Return(@num1+@num2)
End
select add1(10,20) as result
Then the Function is Contructed successfully , But when I call the function usimg Select statement
Error is there--
'add1' is not a recognized built-in function name.
Plz reply whether its necessary to write owner name to prevent errors.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
Similar Threads
- Xpath (XML, XSLT and XPATH)
- How to print to file (Perl)
- retrieving CLOB from an Oracle stored function within perl (Perl)
- Must declare the scalar variables in storedprocedure in sql 2005 (MS SQL)
- PHP Script Translate To VB 6.0 (Visual Basic 4 / 5 / 6)
- Matrix (C++)
- Sorting a map<string,long> by the value... (C)
- reference problems (C)
- storing references to classes (C++)
Other Threads in the MS SQL Forum
- Previous Thread: proble with import from excel
- Next Thread: Trigger updated values not as expected


Linear Mode