   execute alter_seq_stmt; 
   deallocate prepare alter_seq_stmt;
   
-  select max(numericVal(RSP_ID)) + 1 into l_new_seq from KRIM_RSP_T where numericVal(RSP_ID) < 10000;
+  select ifnull(max(numericVal(RSP_ID)) + 1,1) into l_new_seq from KRIM_RSP_T where numericVal(RSP_ID) < 10000;
   set @create_seq := 'CREATE TABLE KRIM_RSP_ID_BS_S (id bigint(19) not null auto_increment, primary key (id)) ENGINE MyISAM';
   prepare create_seq_stmt from @create_seq;
   execute create_seq_stmt;

  execute alter_seq_stmt;
  deallocate prepare alter_seq_stmt;
  
  select max(numericVal(KIM_TYP_ATTR_ID)) + 1 into l_new_seq from KRIM_TYP_ATTR_T where numericVal(KIM_TYP_ATTR_ID) < 10000;
  set @create_seq := 'CREATE TABLE KRIM_TYP_ATTR_ID_BS_S (id bigint(19) not null auto_increment, primary key (id)) ENGINE MyISAM';
  prepare create_seq_stmt from @create_seq;
  execute create_seq_stmt;

  execute alter_seq_stmt;
  deallocate prepare alter_seq_stmt;
  
  select ifnull(max(numericVal(ROLE_MBR_ID)) + 1,1) into l_new_seq from KRIM_ROLE_MBR_T where numericVal(ROLE_MBR_ID) < 10000;
  set @create_seq := 'CREATE TABLE KRIM_ROLE_MBR_ID_BS_S (id bigint(19) not null auto_increment, primary key (id)) ENGINE MyISAM';
  prepare create_seq_stmt from @create_seq;
  execute create_seq_stmt;
