create procedure gmi_tables_name_lower
as
begin

	declare @sqlcommand nvarchar(max);

	DECLARE var_cursor CURSOR FOR
		select ('EXEC sp_rename ''' + TABLE_NAME + ''', ''' + LOWER(TABLE_NAME) +'''') sqlcommand
		from INFORMATION_SCHEMA.TABLES
		where TABLE_NAME not in ('dtproperties','sysdiagrams')
	FOR READ ONLY

	OPEN var_cursor
	FETCH NEXT FROM var_cursor INTO 
		@sqlcommand

	WHILE @@FETCH_STATUS = 0
	BEGIN
		exec sp_executesql @sqlcommand;	

		FETCH NEXT FROM var_cursor INTO 
			@sqlcommand
	END

	CLOSE var_cursor
	DEALLOCATE var_cursor;
end
