﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[getFiduciariaByCodMand]
(@codMand varchar(6))
RETURNS varchar(10)
WITH EXEC AS CALLER
AS
BEGIN
DECLARE @fiduciaria VARCHAR(10)
	SELECT
		@fiduciaria = CODBREVE
	FROM
		C6stagingperiodico.WMANDATI
	WHERE
		CODMAND = @codMand
	RETURN @fiduciaria + '@' + @codMand
END