Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 why this function doesn't work ?

Author  Topic 

java148
Yak Posting Veteran

63 Posts

Posted - 2012-01-12 : 11:38:21
why this function doesn't work ? where is the bug ?


create function udf_MyFuntion()
returns varchar(20)
as
return 'test'

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-01-12 : 11:44:54
Wrap the function body in a BEGIN and an END
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-12 : 11:45:22







create function udf_MyFuntion()
returns varchar(20)
as
begin
return 'test'
end
GO


SELECT dbo.udf_MyFuntion()
GO

DROP FUNCTION udf_MyFuntion
GO



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/

Go to Top of Page
   

- Advertisement -