Quantcast
Channel: IF ELSE vs CASE WHEN
Viewing all articles
Browse latest Browse all 19

IF ELSE vs CASE WHEN

$
0
0

You have not created any function with a name dbo.myfunc(). Create the function, it will resolve your error.


create FUNCTION dbo.myfunc()
RETURNS int 
AS 
BEGIN
       RETURN 100
END;

select case when exists(select name from sysobjects where name = 'myfunc') then dbo.myfunc() else 0 end;

-Prashanth



Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>