Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Placing IF statement on UDF which returns a table

$
0
0

Hi all of you,

I'm stuck..

I know that it is a silly thing...

Thanks for any input!!

My current UDF snippet:

ALTER FUNCTION [dbo].[Formas_de_Pago_Todas](
@idioma char(2))
RETURNS TABLE 
AS

	RETURN ( 
	IF @idioma = 'ES' 
	BEGIN
	SELECT FORMA_PAGO FROM dbo.Talleres_Formas_de_Pago
	END
	ELSE
	SELECT WAY_PAYMENT FROM dbo.Talleres_Formas_de_Pago
    )
	END

GO


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.


Viewing all articles
Browse latest Browse all 15264

Trending Articles



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