How to delete SQL Server Database Mail history WITHOUT stored proceduresWhy use both TRUNCATE and DROP?Database security through stored proceduresHow to split tables without affecting all stored proceduresHow To Profile Stored ProceduresHow to keep history of SQL Server stored procedure revisions~2 Hours after a large insert SQL Server gets “I/O requests taking longer than 15 seconds to complete”High write latancy in temp dbSQL Server's “Total Server Memory” consumption stagnant for months with 64GB+ more availableSQL Server and TFS - How to rename stored proceduresTransaction log filling the drive if mirroring failsWhat Triggers sp_recompile in database without triggers, stored procedures, etc?

Realistic, logical way for men with medieval-era weaponry to compete with much larger and physically stronger foes

Jam with honey & without pectin has a saucy consistency always

Parallelized for loop in Bash

Should I worry about having my credit pulled multiple times while car shopping?

Fastest way from 10 to 1 with everyone in between

Why are backslashes included in this shell script?

Commencez à vous connecter -- I don't understand the phrasing of this

My parents claim they cannot pay for my college education; what are my options?

Idiom for 'person who gets violent when drunk"

How can religions without a hell discourage evil-doing?

Why did the AvroCar fail to fly above 3 feet?

Why does there seem to be an extreme lack of public trashcans in Taiwan?

Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?

Why is gun control associated with the socially liberal Democratic party?

Harley Davidson clattering noise from engine, backfire and failure to start

Am I allowed to determine tenets of my contract as a warlock?

How to represent jealousy in a cute way?

Can artificial satellite positions affect tides?

Shouldn't it take more energy to break CO2 compared to CO?

What game uses dice with compass point arrows, forbidden signs, explosions, arrows and targeting reticles?

Past vs. present tense when referring to a fictional character

What's the reason for the decade jump in the recent X-Men trilogy?

Approach sick days in feedback meeting

typeid("") != typeid(const char*)



How to delete SQL Server Database Mail history WITHOUT stored procedures


Why use both TRUNCATE and DROP?Database security through stored proceduresHow to split tables without affecting all stored proceduresHow To Profile Stored ProceduresHow to keep history of SQL Server stored procedure revisions~2 Hours after a large insert SQL Server gets “I/O requests taking longer than 15 seconds to complete”High write latancy in temp dbSQL Server's “Total Server Memory” consumption stagnant for months with 64GB+ more availableSQL Server and TFS - How to rename stored proceduresTransaction log filling the drive if mirroring failsWhat Triggers sp_recompile in database without triggers, stored procedures, etc?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















This is really straight forward. The documented way to delete Database mail history in SQL server is to use the following two stored procedures:sysmail_delete_mailitems_sp and sysmail_delete_log_sp



Great. But what happens when apparently billions of emails are stored in here taking up several hundred gigabytes in msdb, and even the process of trying to clear only 100 days worth of email takes hours or days?



I don't want any history and I don't want to wait until I'm a senior citizen to clear the list of e-mail history. How do I truncate this history in one quick transaction?



So far my efforts at using the built in procedures have been futile - growing tempdb and msdb to terabytes in size and sitting "executing" for hours on end. Any attempt to cancel it results in the entire transaction being rolled back. It so far hasn't even been possible to count the number of emails that exist in the history - it's that bad.










share|improve this question













migrated from serverfault.com May 30 at 0:44


This question came from our site for system and network administrators.
























    1















    This is really straight forward. The documented way to delete Database mail history in SQL server is to use the following two stored procedures:sysmail_delete_mailitems_sp and sysmail_delete_log_sp



    Great. But what happens when apparently billions of emails are stored in here taking up several hundred gigabytes in msdb, and even the process of trying to clear only 100 days worth of email takes hours or days?



    I don't want any history and I don't want to wait until I'm a senior citizen to clear the list of e-mail history. How do I truncate this history in one quick transaction?



    So far my efforts at using the built in procedures have been futile - growing tempdb and msdb to terabytes in size and sitting "executing" for hours on end. Any attempt to cancel it results in the entire transaction being rolled back. It so far hasn't even been possible to count the number of emails that exist in the history - it's that bad.










    share|improve this question













    migrated from serverfault.com May 30 at 0:44


    This question came from our site for system and network administrators.




















      1












      1








      1








      This is really straight forward. The documented way to delete Database mail history in SQL server is to use the following two stored procedures:sysmail_delete_mailitems_sp and sysmail_delete_log_sp



      Great. But what happens when apparently billions of emails are stored in here taking up several hundred gigabytes in msdb, and even the process of trying to clear only 100 days worth of email takes hours or days?



      I don't want any history and I don't want to wait until I'm a senior citizen to clear the list of e-mail history. How do I truncate this history in one quick transaction?



      So far my efforts at using the built in procedures have been futile - growing tempdb and msdb to terabytes in size and sitting "executing" for hours on end. Any attempt to cancel it results in the entire transaction being rolled back. It so far hasn't even been possible to count the number of emails that exist in the history - it's that bad.










      share|improve this question














      This is really straight forward. The documented way to delete Database mail history in SQL server is to use the following two stored procedures:sysmail_delete_mailitems_sp and sysmail_delete_log_sp



      Great. But what happens when apparently billions of emails are stored in here taking up several hundred gigabytes in msdb, and even the process of trying to clear only 100 days worth of email takes hours or days?



      I don't want any history and I don't want to wait until I'm a senior citizen to clear the list of e-mail history. How do I truncate this history in one quick transaction?



      So far my efforts at using the built in procedures have been futile - growing tempdb and msdb to terabytes in size and sitting "executing" for hours on end. Any attempt to cancel it results in the entire transaction being rolled back. It so far hasn't even been possible to count the number of emails that exist in the history - it's that bad.







      sql-server






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 29 at 21:06









      AppleoddityAppleoddity

      1163




      1163




      migrated from serverfault.com May 30 at 0:44


      This question came from our site for system and network administrators.









      migrated from serverfault.com May 30 at 0:44


      This question came from our site for system and network administrators.






















          2 Answers
          2






          active

          oldest

          votes


















          2














          One idea could be:



          1. script out CREATE TABLE for sysmail_attachments, sysmail_send_retries, sysmail_mailitems, and sysmail_log

          2. start a transaction

          3. drop the tables in that order

          4. create the tables again using the script from 1.

          5. commit the transaction

          6. create a job that purges those tables regularly (like, once an hour, from the sounds of it), also in that order





          share|improve this answer























          • Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

            – Appleoddity
            May 30 at 5:37











          • @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

            – Aaron Bertrand
            May 30 at 10:39



















          1














          Building on @Aaron Bertrand's answer. I decided to delete the foreign key constraints and truncate the tables and then recreate the constraints.



          This is the script I used to clear the e-mail history and it took about 1 second to run total:



          BEGIN TRANSACTION;

          USE MSDB;

          ALTER TABLE [dbo].[sysmail_attachments] DROP [FK_sysmail_mailitems_mailitem_id];
          TRUNCATE TABLE [dbo].[sysmail_attachments];

          ALTER TABLE [dbo].[sysmail_send_retries] DROP [FK_mailitems_mailitem_id];
          TRUNCATE TABLE [dbo].[sysmail_send_retries];

          TRUNCATE TABLE [dbo].[sysmail_mailitems];

          TRUNCATE TABLE [dbo].[sysmail_log];

          ALTER TABLE [dbo].[sysmail_attachments] WITH CHECK ADD CONSTRAINT [FK_sysmail_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
          REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
          ON DELETE CASCADE
          ALTER TABLE [dbo].[sysmail_attachments] CHECK CONSTRAINT [FK_sysmail_mailitems_mailitem_id]

          ALTER TABLE [dbo].[sysmail_send_retries] WITH CHECK ADD CONSTRAINT [FK_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
          REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
          ON DELETE CASCADE
          ALTER TABLE [dbo].[sysmail_send_retries] CHECK CONSTRAINT [FK_mailitems_mailitem_id]

          COMMIT;


          After that, it was just a matter or shrinking (and setting the initial size of) the msdb and tempdb databases.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "182"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f239409%2fhow-to-delete-sql-server-database-mail-history-without-stored-procedures%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            One idea could be:



            1. script out CREATE TABLE for sysmail_attachments, sysmail_send_retries, sysmail_mailitems, and sysmail_log

            2. start a transaction

            3. drop the tables in that order

            4. create the tables again using the script from 1.

            5. commit the transaction

            6. create a job that purges those tables regularly (like, once an hour, from the sounds of it), also in that order





            share|improve this answer























            • Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

              – Appleoddity
              May 30 at 5:37











            • @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

              – Aaron Bertrand
              May 30 at 10:39
















            2














            One idea could be:



            1. script out CREATE TABLE for sysmail_attachments, sysmail_send_retries, sysmail_mailitems, and sysmail_log

            2. start a transaction

            3. drop the tables in that order

            4. create the tables again using the script from 1.

            5. commit the transaction

            6. create a job that purges those tables regularly (like, once an hour, from the sounds of it), also in that order





            share|improve this answer























            • Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

              – Appleoddity
              May 30 at 5:37











            • @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

              – Aaron Bertrand
              May 30 at 10:39














            2












            2








            2







            One idea could be:



            1. script out CREATE TABLE for sysmail_attachments, sysmail_send_retries, sysmail_mailitems, and sysmail_log

            2. start a transaction

            3. drop the tables in that order

            4. create the tables again using the script from 1.

            5. commit the transaction

            6. create a job that purges those tables regularly (like, once an hour, from the sounds of it), also in that order





            share|improve this answer













            One idea could be:



            1. script out CREATE TABLE for sysmail_attachments, sysmail_send_retries, sysmail_mailitems, and sysmail_log

            2. start a transaction

            3. drop the tables in that order

            4. create the tables again using the script from 1.

            5. commit the transaction

            6. create a job that purges those tables regularly (like, once an hour, from the sounds of it), also in that order






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 30 at 1:19









            Aaron BertrandAaron Bertrand

            157k18307514




            157k18307514












            • Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

              – Appleoddity
              May 30 at 5:37











            • @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

              – Aaron Bertrand
              May 30 at 10:39


















            • Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

              – Appleoddity
              May 30 at 5:37











            • @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

              – Aaron Bertrand
              May 30 at 10:39

















            Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

            – Appleoddity
            May 30 at 5:37





            Thank you for your answer. I had already decided to try a similar method of dropping the foreign key constraints and truncating the tables. It seems to have worked properly. Take a look and see if you see any issues in my answer. I appreciate your help!

            – Appleoddity
            May 30 at 5:37













            @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

            – Aaron Bertrand
            May 30 at 10:39






            @Appleoddity well, removing keys and truncating is a lot more work, obviously, and there is a tiny bit more logging involved, and some more too with the FK changes, but whatever floats your boat I guess.

            – Aaron Bertrand
            May 30 at 10:39














            1














            Building on @Aaron Bertrand's answer. I decided to delete the foreign key constraints and truncate the tables and then recreate the constraints.



            This is the script I used to clear the e-mail history and it took about 1 second to run total:



            BEGIN TRANSACTION;

            USE MSDB;

            ALTER TABLE [dbo].[sysmail_attachments] DROP [FK_sysmail_mailitems_mailitem_id];
            TRUNCATE TABLE [dbo].[sysmail_attachments];

            ALTER TABLE [dbo].[sysmail_send_retries] DROP [FK_mailitems_mailitem_id];
            TRUNCATE TABLE [dbo].[sysmail_send_retries];

            TRUNCATE TABLE [dbo].[sysmail_mailitems];

            TRUNCATE TABLE [dbo].[sysmail_log];

            ALTER TABLE [dbo].[sysmail_attachments] WITH CHECK ADD CONSTRAINT [FK_sysmail_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
            REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
            ON DELETE CASCADE
            ALTER TABLE [dbo].[sysmail_attachments] CHECK CONSTRAINT [FK_sysmail_mailitems_mailitem_id]

            ALTER TABLE [dbo].[sysmail_send_retries] WITH CHECK ADD CONSTRAINT [FK_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
            REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
            ON DELETE CASCADE
            ALTER TABLE [dbo].[sysmail_send_retries] CHECK CONSTRAINT [FK_mailitems_mailitem_id]

            COMMIT;


            After that, it was just a matter or shrinking (and setting the initial size of) the msdb and tempdb databases.






            share|improve this answer



























              1














              Building on @Aaron Bertrand's answer. I decided to delete the foreign key constraints and truncate the tables and then recreate the constraints.



              This is the script I used to clear the e-mail history and it took about 1 second to run total:



              BEGIN TRANSACTION;

              USE MSDB;

              ALTER TABLE [dbo].[sysmail_attachments] DROP [FK_sysmail_mailitems_mailitem_id];
              TRUNCATE TABLE [dbo].[sysmail_attachments];

              ALTER TABLE [dbo].[sysmail_send_retries] DROP [FK_mailitems_mailitem_id];
              TRUNCATE TABLE [dbo].[sysmail_send_retries];

              TRUNCATE TABLE [dbo].[sysmail_mailitems];

              TRUNCATE TABLE [dbo].[sysmail_log];

              ALTER TABLE [dbo].[sysmail_attachments] WITH CHECK ADD CONSTRAINT [FK_sysmail_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
              REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
              ON DELETE CASCADE
              ALTER TABLE [dbo].[sysmail_attachments] CHECK CONSTRAINT [FK_sysmail_mailitems_mailitem_id]

              ALTER TABLE [dbo].[sysmail_send_retries] WITH CHECK ADD CONSTRAINT [FK_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
              REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
              ON DELETE CASCADE
              ALTER TABLE [dbo].[sysmail_send_retries] CHECK CONSTRAINT [FK_mailitems_mailitem_id]

              COMMIT;


              After that, it was just a matter or shrinking (and setting the initial size of) the msdb and tempdb databases.






              share|improve this answer

























                1












                1








                1







                Building on @Aaron Bertrand's answer. I decided to delete the foreign key constraints and truncate the tables and then recreate the constraints.



                This is the script I used to clear the e-mail history and it took about 1 second to run total:



                BEGIN TRANSACTION;

                USE MSDB;

                ALTER TABLE [dbo].[sysmail_attachments] DROP [FK_sysmail_mailitems_mailitem_id];
                TRUNCATE TABLE [dbo].[sysmail_attachments];

                ALTER TABLE [dbo].[sysmail_send_retries] DROP [FK_mailitems_mailitem_id];
                TRUNCATE TABLE [dbo].[sysmail_send_retries];

                TRUNCATE TABLE [dbo].[sysmail_mailitems];

                TRUNCATE TABLE [dbo].[sysmail_log];

                ALTER TABLE [dbo].[sysmail_attachments] WITH CHECK ADD CONSTRAINT [FK_sysmail_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
                REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
                ON DELETE CASCADE
                ALTER TABLE [dbo].[sysmail_attachments] CHECK CONSTRAINT [FK_sysmail_mailitems_mailitem_id]

                ALTER TABLE [dbo].[sysmail_send_retries] WITH CHECK ADD CONSTRAINT [FK_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
                REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
                ON DELETE CASCADE
                ALTER TABLE [dbo].[sysmail_send_retries] CHECK CONSTRAINT [FK_mailitems_mailitem_id]

                COMMIT;


                After that, it was just a matter or shrinking (and setting the initial size of) the msdb and tempdb databases.






                share|improve this answer













                Building on @Aaron Bertrand's answer. I decided to delete the foreign key constraints and truncate the tables and then recreate the constraints.



                This is the script I used to clear the e-mail history and it took about 1 second to run total:



                BEGIN TRANSACTION;

                USE MSDB;

                ALTER TABLE [dbo].[sysmail_attachments] DROP [FK_sysmail_mailitems_mailitem_id];
                TRUNCATE TABLE [dbo].[sysmail_attachments];

                ALTER TABLE [dbo].[sysmail_send_retries] DROP [FK_mailitems_mailitem_id];
                TRUNCATE TABLE [dbo].[sysmail_send_retries];

                TRUNCATE TABLE [dbo].[sysmail_mailitems];

                TRUNCATE TABLE [dbo].[sysmail_log];

                ALTER TABLE [dbo].[sysmail_attachments] WITH CHECK ADD CONSTRAINT [FK_sysmail_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
                REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
                ON DELETE CASCADE
                ALTER TABLE [dbo].[sysmail_attachments] CHECK CONSTRAINT [FK_sysmail_mailitems_mailitem_id]

                ALTER TABLE [dbo].[sysmail_send_retries] WITH CHECK ADD CONSTRAINT [FK_mailitems_mailitem_id] FOREIGN KEY([mailitem_id])
                REFERENCES [dbo].[sysmail_mailitems] ([mailitem_id])
                ON DELETE CASCADE
                ALTER TABLE [dbo].[sysmail_send_retries] CHECK CONSTRAINT [FK_mailitems_mailitem_id]

                COMMIT;


                After that, it was just a matter or shrinking (and setting the initial size of) the msdb and tempdb databases.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 30 at 5:34









                AppleoddityAppleoddity

                1163




                1163



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f239409%2fhow-to-delete-sql-server-database-mail-history-without-stored-procedures%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company