﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[fds__fn_invoice_customerid]
(
	@InvId varchar(15)
)
RETURNS bigint
AS
BEGIN
	DECLARE @ret bigint;

	SELECT TOP(1) @ret = [customerid] FROM dbo.[fds__invoices] WHERE [id] = @InvId;
	
	RETURN @ret;

END