Strange behavior of SQL Server. I need to raise this issue with Microsoft techies. Let me check it and blog the same with the reason.
create function Venkat_fun2(@a int)
returns int
as begin
RETURN
(select id from venkat where id=@a)
end
select Venkat_fun2(1)

Thanks and Regards,
Venkatesan Prabu .J
Found the problem.
ReplyDeleteWe need to add the schemaname.FunctionName to execute it.
alter function Venkat_fun2(@a int)
returns int
as begin
RETURN
(select id from venkat where id=@a)
end
select dbo.Venkat_fun2(1)
The above query will work.
Thanks and Regards,
Venkatesan Prabu .J
Hi Venkat
ReplyDeleteI am T-SQL Developer and am working for past one and half years in SQL. I need to complete certification can you provide me some tips to complete the certifications. It will help for my preparation.
Regards
Amarnath
Try this
ReplyDeletecreate function Venkat_fun2(@a int)
returns int
as begin
RETURN
(select id from venkat where id=@a)
end
GO
select dbo.Venkat_fun2(1)
sqlblogcasts.com/blogs/madhivanan