SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

IF EXISTS (Select * From sys.objects 
   Where object_id = OBJECT_ID(N'GetDescripcionAlmacen') )
DROP Function GetDescripcionAlmacen
GO

Create FUNCTION GetDescripcionAlmacen 
                (@id_alma as integer)  
RETURNS varchar(50)  AS  
BEGIN 
/*
   Date: Apr 21,2016

   Obtiene la descripcion 
   del almacen

*/	
	Declare @Result as varchar(50)

	Select @Result = descripcion
		From STOKALMA
		where id_alma = @id_alma

	return @Result
END
