Inserting multiple records dynamic

  • Good day,
    I need to insert 7000 records into Table B and also add the same message to all 7000 records dynamical, selecting the values from Table A.

    I hope i'm clear and can assist

    Table A (Source)
    Name
    Surname
    Email Add

    Table B (destination)
    INSERT INTO [dbo].[email_queue]
               ([subscriber_code]
               ,[employee_number]
               ,[email_recipient]
               ,[email_subject]
               ,[email_body]
               ,[email_creation_date]
               ,[action_date]
               ,[retry_attempts]
               ,[retry_when]
               ,[is_appointment])
    SELECT 'USSD', '[dynamic email add]', '[dynamic email add]','Dummy Jobs - Request to Update Details',
    '<html><head><TITLE> dummy Jobs </TITLE> </head><body>
    <table style="width:800px"><tr><td><img src="https://www.dummy.mobi/Content/Img/ec/dummy_Email_Header.png"></td></tr>
      <tr><td><table style="background:#FFFFFF;font-size:9.0pt;font-family:Arial;"><tr><td>Dear Candidate,<br><br>
    We have updated our CareerSite to ensure that searching and applying for roles within the Dummy Group is easier for you with the aim of improving the recruitment experience.
    Kindly login to your profile and capture the required fields that are necessary for job applications moving forward. Unfortunately, you will not be able to apply for any future roles without updating your profile.
    <br><br>Thank you for your participation.<br><br>Kind Regards,<br>Dummy Group Recruitment</td></tr><tr><td>&nbsp;</td></tr></table></td></tr>
      <tr><td><img src="https://www.dummy.mobi/Content/Img/ec/dummy_Email_Footer.png"></td></tr></table>
    </body></html>'
    ,getdate(),getdate(),0,getdate(),0

    It's better to fail while trying, rather than fail without trying!!!

  • smthembu - Monday, February 19, 2018 9:37 AM

    Good day,
    I need to insert 7000 records into Table B and also add the same message to all 7000 records dynamical, selecting the values from Table A.

    I hope i'm clear and can assist

    Table A (Source)
    Name
    Surname
    Email Add

    Table B (destination)
    INSERT INTO [dbo].[email_queue]
               ([subscriber_code]
               ,[employee_number]
               ,[email_recipient]
               ,[email_subject]
               ,[email_body]
               ,[email_creation_date]
               ,[action_date]
               ,[retry_attempts]
               ,[retry_when]
               ,[is_appointment])
    SELECT 'USSD', '[dynamic email add]', '[dynamic email add]','Dummy Jobs - Request to Update Details',
    '<html><head><TITLE> dummy Jobs </TITLE> </head><body>
    <table style="width:800px"><tr><td><img src="https://www.dummy.mobi/Content/Img/ec/dummy_Email_Header.png"></td></tr>
      <tr><td><table style="background:#FFFFFF;font-size:9.0pt;font-family:Arial;"><tr><td>Dear Candidate,<br><br>
    We have updated our CareerSite to ensure that searching and applying for roles within the Dummy Group is easier for you with the aim of improving the recruitment experience.
    Kindly login to your profile and capture the required fields that are necessary for job applications moving forward. Unfortunately, you will not be able to apply for any future roles without updating your profile.
    <br><br>Thank you for your participation.<br><br>Kind Regards,<br>Dummy Group Recruitment</td></tr><tr><td>&nbsp;</td></tr></table></td></tr>
      <tr><td><img src="https://www.dummy.mobi/Content/Img/ec/dummy_Email_Footer.png"></td></tr></table>
    </body></html>'
    ,getdate(),getdate(),0,getdate(),0

    Your message is difficult to read. Can you reformat it?
    What is the link between table A and table B?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply