IF (EXISTS(Select * from sys.sysprocedure where LCase(proc_name) = LCase('GetVatRateInvoice')))
THEN Drop procedure GetVatRateInvoice
END IF

GO

create function DBA.GetVatRateInvoice(in @InvoiceNo integer)
returns varchar(10)
begin
  declare @res varchar(10);
  set @res=cast((select top 1 VatRate from Articles where InvoiceNo = @InvoiceNo)*100 as integer) || ' %';
  return(@res)
end