SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FN_VEM_TARIHSAAT]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
BEGIN
execute dbo.sp_executesql @statement = N'CREATE FUNCTION [dbo].[FN_VEM_TARIHSAAT]
(
	@TarihSaat datetime
)
RETURNS nvarchar(14)
AS
BEGIN
	RETURN REPLACE(REPLACE(REPLACE(CONVERT(NVARCHAR(20), @TarihSaat, 120), ''-'', ''''), '' '', ''''), '':'', '''')
END
' 
END

GO


