Advertisement
0re5ama

Untitled

Aug 18th, 2022
1,109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 3.19 KB | None | 0 0
  1. alter table bb_company_branch_mapping add constraint fk_bb_company_branch_mapping_sender_mst foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  2. alter table bb_company_branch_mapping add constraint fk_bb_company_branch_mapping_sub_agent foreign key (parent_agent_cd, sub_agent_cd) references sub_agent (parent_agent_cd, sub_agent_cd);
  3. alter table bb_company_branch_mapping alter column created_by varchar(30);
  4. alter table bb_company_branch_mapping alter column modified_by varchar(30);
  5. alter table bb_company_branch_mapping add constraint fk_bb_company_branch_mapping_created_by foreign key (cre_parent_agent_cd, created_by) references remit_user (parent_agent_cd, remit_user_cd);
  6. alter table bb_company_branch_mapping add constraint fk_bb_company_branch_mapping_modified_by foreign key (mod_parent_agent_cd, modified_by) references remit_user (parent_agent_cd, remit_user_cd);
  7.  
  8. -- bb_company_branch_mapping_hist
  9.  
  10. alter table bb_company_document drop constraint pk_bb_company_document;
  11. alter table bb_company_document add constraint pk_bb_company_document primary key (sender_auto_id, document_no);
  12.  
  13. alter table bb_company_document add constraint fk_bb_company_document_sender foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  14. alter table bb_company_document alter column created_by varchar(30);
  15. alter table bb_company_document add constraint fk_bb_company_document_created_by foreign key (cre_parent_agent_cd, created_by) references remit_user (parent_agent_cd, remit_user_cd);
  16.  
  17. alter table bb_company_nature_business add constraint fk_bb_company_nature_business_sender foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  18.  
  19. -- bb_company_nature_business_hist
  20.  
  21. alter table bb_company_person add constraint fk_bb_company_person foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  22. create index ix_bb_company_person_sender on bb_company_person (sender_auto_id);
  23.  
  24. -- bb_company_person_hist
  25.  
  26. alter table bb_company_person_temp_edit add constraint fk_bb_company_person_temp_edit_sender foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  27.  
  28. alter table bb_tran_company_document_amount add constraint fk_bb_tran_company_document_amount foreign key (sender_auto_id, document_no) references bb_company_document (sender_auto_id, document_no);
  29.  
  30. alter table bb_tran_company_document_amount  add constraint fk_bb_tran_company_document_amount_tran foreign key (tran_id) references tran_master (tran_id);
  31.  
  32.  
  33. alter table bb_authorised_personnel add constraint fk_bb_authorised_personnel foreign key (sender_auto_id) references sender_mst (sender_auto_id);
  34.  
  35. alter table bb_authorised_personnel alter column created_by varchar(30);
  36. alter table bb_authorised_personnel alter column modified_by varchar(30);
  37. alter table bb_authorised_personnel alter column is_approve_by varchar(30);
  38. alter table bb_authorised_personnel add constraint fk_bb_authorised_personnel_created_by foreign key (cre_parent_agent_cd, created_by) references remit_user (parent_agent_cd, remit_user_cd);
  39. alter table bb_authorised_personnel add constraint fk_bb_authorised_personnel_modifired_by foreign key (mod_parent_agent_cd, modified_by) references remit_user (parent_agent_cd, remit_user_cd);
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement