if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Trunc]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[Trunc]

GO
create  function Trunc(@f money)
returns int
as
begin
Declare @Result int
if @f>=0  Set @Result=Floor(@f)
else Set @Result=Ceiling(@f)

Return @Result

end
