SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE FUNCTION [dbo].[f_camel_case]
(
	@value		ais_name
)
RETURNS ais_name
AS
BEGIN

	

	/*
	[DGE]
		Cette fonction transforme une chaîne de caractères de forme aa_bb_cc en aaBbCc.
		
		Exemple: 
			champ 	fld_table_name		---> fldTableName
	*/

	DECLARE	@result	ais_name
	
	if LEN(@value) = 0
		return ''
		
								
	select	@result = dbo.f_capitalize(@value)
	
	select	@result = LOWER(LEFT(@result, 1)) + SUBSTRING(@result, 2, 1000)

	return	@result
	
	
END

	

GO
