 
 	SET out_errors := '';
 
+	-- Check to see if the specified table exists
+	SET c := (SELECT COUNT(*) FROM information_schema.tables
+			WHERE BINARY TABLE_SCHEMA = BINARY audit_schema_name 
+				AND BINARY table_name = BINARY audit_table_name);
+	IF c <> 1 THEN
+		SET out_errors := CONCAT( out_errors, '\n', 'The table you specified `', audit_schema_name, '`.`', audit_table_name, '` does not exists.' );
+		LEAVE main_block;
+	END IF;
+
 
 	-- Check audit and meta table exists
 	SET c := (SELECT COUNT(*) FROM information_schema.tables

				AND (BINARY table_name = BINARY 'zaudit' OR BINARY table_name = BINARY 'zaudit_meta') );
	IF c <> 2 THEN
		SET out_errors := CONCAT( out_errors, '\n', 'Audit table structure do not exists, please check or run the audit setup script again.' );
	END IF;


	-- Check to see if the specified table exists
	SET c := (SELECT COUNT(*) FROM information_schema.tables
			WHERE BINARY TABLE_SCHEMA = BINARY audit_schema_name 
				AND BINARY table_name = BINARY audit_table_name);
	IF c <> 1 THEN
		SET out_errors := CONCAT( out_errors, '\n', 'The table you specified `', audit_schema_name, '`.`', audit_table_name, '` does not exists.' );
	END IF;



				AND BINARY table_name = BINARY audit_table_name
			AND column_key = 'PRI' LIMIT 1,1);

	-- Check at least one id exists
	IF at_id1 IS NULL AND at_id2 IS NULL THEN 
		SET out_errors := CONCAT( out_errors, '\n', 'The table you specified `', audit_schema_name, '`.`', audit_table_name, '` does not have any primary key.' );
	END IF;



	SET header := CONCAT( 
		'-- --------------------------------------------------------------------\n',
