View SQL code for job in SQL Server Management Studio












0















I want to view the SQL code that is executed for a particular job in SQL Server Management Studio.



Specifically, I have a screen that looks like this:



enter image description here



If I double click it I get a screen that looks like this:



enter image description here



That is not really helpful. I want to see the actual code that is running and possibly modify it.



I am a long time developer but new to Windows so please give an answer that uses terminology that I can see on the screen.



[EDIT] If I click the edit button on the first screen I get the same screen as if I double click it. There is a DTSRun command and some jibberish which is not anything I would expect to edit.



[EDIT] I followed these instructions to decode the encrypted command line:



https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



Then I could see the command line looks like this:



DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



I then searched the entire computer for a filename that contained AppErrors in the name. I did not find one.



So I am getting closer, but how do I find what that is executing?










share|improve this question

























  • You should click Edit button on the first window.

    – Orhun
    Nov 18 '18 at 4:37
















0















I want to view the SQL code that is executed for a particular job in SQL Server Management Studio.



Specifically, I have a screen that looks like this:



enter image description here



If I double click it I get a screen that looks like this:



enter image description here



That is not really helpful. I want to see the actual code that is running and possibly modify it.



I am a long time developer but new to Windows so please give an answer that uses terminology that I can see on the screen.



[EDIT] If I click the edit button on the first screen I get the same screen as if I double click it. There is a DTSRun command and some jibberish which is not anything I would expect to edit.



[EDIT] I followed these instructions to decode the encrypted command line:



https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



Then I could see the command line looks like this:



DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



I then searched the entire computer for a filename that contained AppErrors in the name. I did not find one.



So I am getting closer, but how do I find what that is executing?










share|improve this question

























  • You should click Edit button on the first window.

    – Orhun
    Nov 18 '18 at 4:37














0












0








0








I want to view the SQL code that is executed for a particular job in SQL Server Management Studio.



Specifically, I have a screen that looks like this:



enter image description here



If I double click it I get a screen that looks like this:



enter image description here



That is not really helpful. I want to see the actual code that is running and possibly modify it.



I am a long time developer but new to Windows so please give an answer that uses terminology that I can see on the screen.



[EDIT] If I click the edit button on the first screen I get the same screen as if I double click it. There is a DTSRun command and some jibberish which is not anything I would expect to edit.



[EDIT] I followed these instructions to decode the encrypted command line:



https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



Then I could see the command line looks like this:



DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



I then searched the entire computer for a filename that contained AppErrors in the name. I did not find one.



So I am getting closer, but how do I find what that is executing?










share|improve this question
















I want to view the SQL code that is executed for a particular job in SQL Server Management Studio.



Specifically, I have a screen that looks like this:



enter image description here



If I double click it I get a screen that looks like this:



enter image description here



That is not really helpful. I want to see the actual code that is running and possibly modify it.



I am a long time developer but new to Windows so please give an answer that uses terminology that I can see on the screen.



[EDIT] If I click the edit button on the first screen I get the same screen as if I double click it. There is a DTSRun command and some jibberish which is not anything I would expect to edit.



[EDIT] I followed these instructions to decode the encrypted command line:



https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



Then I could see the command line looks like this:



DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



I then searched the entire computer for a filename that contained AppErrors in the name. I did not find one.



So I am getting closer, but how do I find what that is executing?







sql-server-2008 ssms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 2:16







Michael Potter

















asked Nov 18 '18 at 4:21









Michael PotterMichael Potter

3,89753763




3,89753763













  • You should click Edit button on the first window.

    – Orhun
    Nov 18 '18 at 4:37



















  • You should click Edit button on the first window.

    – Orhun
    Nov 18 '18 at 4:37

















You should click Edit button on the first window.

– Orhun
Nov 18 '18 at 4:37





You should click Edit button on the first window.

– Orhun
Nov 18 '18 at 4:37












2 Answers
2






active

oldest

votes


















0














There is no SQL code in this job/task, because the task type is "Operating system (CmdExec)", i.e. this is not a SQL query, but starting of Windows executable file. There will be SQL code for step type "Transact-SQL script (T-SQL)":



enter image description here



What you see in you job step, is execution of SSIS package, which is encrypted. For more information about DTSRun command, take a look at this article - SQL Server DTS command line utility.






share|improve this answer































    0














    I almost solved my problem like this:



    A.
    I followed the instructions here to decode the encrypted command line:



    https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



    Which amounted to:




    1. Copy the DTSRUN line (everything including the DTSRUN)

    2. Open a Windows Command Line window

    3. Paste the DTSRUN line into the CMD window.

    4. To the end of the line, add /!X /!C
      /!X = do not execute /!C = copy results onto Windows Clipboard

    5. Run the command

    6. Open Notepad

    7. Click Edit>Paste
      that will paste the actual command into Notepad and it will show the name of the package.


    B.
    I observed that the command line looked like this:



    DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



    C.
    Then I follow the instructions here to find the code:



    https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc645945(v=sql.105)



    which amounted to:




    1. In Object Explorer, expand the Management folder.


    2. Expand the Legacy subfolder.


    3. Expand the Data Transformation Services subfolder to show packages.



    D.
    I right click on it and choose Open. I get this error:



    enter image description here



    I should not have to install anything because the person who put this on the machine must have been able to edit it. (this person is completely unavailable so I can't ask him). The reason I need access to it is that we are upgrading the machine.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2fstackoverflow.com%2fquestions%2f53357860%2fview-sql-code-for-job-in-sql-server-management-studio%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









      0














      There is no SQL code in this job/task, because the task type is "Operating system (CmdExec)", i.e. this is not a SQL query, but starting of Windows executable file. There will be SQL code for step type "Transact-SQL script (T-SQL)":



      enter image description here



      What you see in you job step, is execution of SSIS package, which is encrypted. For more information about DTSRun command, take a look at this article - SQL Server DTS command line utility.






      share|improve this answer




























        0














        There is no SQL code in this job/task, because the task type is "Operating system (CmdExec)", i.e. this is not a SQL query, but starting of Windows executable file. There will be SQL code for step type "Transact-SQL script (T-SQL)":



        enter image description here



        What you see in you job step, is execution of SSIS package, which is encrypted. For more information about DTSRun command, take a look at this article - SQL Server DTS command line utility.






        share|improve this answer


























          0












          0








          0







          There is no SQL code in this job/task, because the task type is "Operating system (CmdExec)", i.e. this is not a SQL query, but starting of Windows executable file. There will be SQL code for step type "Transact-SQL script (T-SQL)":



          enter image description here



          What you see in you job step, is execution of SSIS package, which is encrypted. For more information about DTSRun command, take a look at this article - SQL Server DTS command line utility.






          share|improve this answer













          There is no SQL code in this job/task, because the task type is "Operating system (CmdExec)", i.e. this is not a SQL query, but starting of Windows executable file. There will be SQL code for step type "Transact-SQL script (T-SQL)":



          enter image description here



          What you see in you job step, is execution of SSIS package, which is encrypted. For more information about DTSRun command, take a look at this article - SQL Server DTS command line utility.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 18 '18 at 11:42









          Andrey NikolovAndrey Nikolov

          3,8533721




          3,8533721

























              0














              I almost solved my problem like this:



              A.
              I followed the instructions here to decode the encrypted command line:



              https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



              Which amounted to:




              1. Copy the DTSRUN line (everything including the DTSRUN)

              2. Open a Windows Command Line window

              3. Paste the DTSRUN line into the CMD window.

              4. To the end of the line, add /!X /!C
                /!X = do not execute /!C = copy results onto Windows Clipboard

              5. Run the command

              6. Open Notepad

              7. Click Edit>Paste
                that will paste the actual command into Notepad and it will show the name of the package.


              B.
              I observed that the command line looked like this:



              DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



              C.
              Then I follow the instructions here to find the code:



              https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc645945(v=sql.105)



              which amounted to:




              1. In Object Explorer, expand the Management folder.


              2. Expand the Legacy subfolder.


              3. Expand the Data Transformation Services subfolder to show packages.



              D.
              I right click on it and choose Open. I get this error:



              enter image description here



              I should not have to install anything because the person who put this on the machine must have been able to edit it. (this person is completely unavailable so I can't ask him). The reason I need access to it is that we are upgrading the machine.






              share|improve this answer




























                0














                I almost solved my problem like this:



                A.
                I followed the instructions here to decode the encrypted command line:



                https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



                Which amounted to:




                1. Copy the DTSRUN line (everything including the DTSRUN)

                2. Open a Windows Command Line window

                3. Paste the DTSRUN line into the CMD window.

                4. To the end of the line, add /!X /!C
                  /!X = do not execute /!C = copy results onto Windows Clipboard

                5. Run the command

                6. Open Notepad

                7. Click Edit>Paste
                  that will paste the actual command into Notepad and it will show the name of the package.


                B.
                I observed that the command line looked like this:



                DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



                C.
                Then I follow the instructions here to find the code:



                https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc645945(v=sql.105)



                which amounted to:




                1. In Object Explorer, expand the Management folder.


                2. Expand the Legacy subfolder.


                3. Expand the Data Transformation Services subfolder to show packages.



                D.
                I right click on it and choose Open. I get this error:



                enter image description here



                I should not have to install anything because the person who put this on the machine must have been able to edit it. (this person is completely unavailable so I can't ask him). The reason I need access to it is that we are upgrading the machine.






                share|improve this answer


























                  0












                  0








                  0







                  I almost solved my problem like this:



                  A.
                  I followed the instructions here to decode the encrypted command line:



                  https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



                  Which amounted to:




                  1. Copy the DTSRUN line (everything including the DTSRUN)

                  2. Open a Windows Command Line window

                  3. Paste the DTSRUN line into the CMD window.

                  4. To the end of the line, add /!X /!C
                    /!X = do not execute /!C = copy results onto Windows Clipboard

                  5. Run the command

                  6. Open Notepad

                  7. Click Edit>Paste
                    that will paste the actual command into Notepad and it will show the name of the package.


                  B.
                  I observed that the command line looked like this:



                  DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



                  C.
                  Then I follow the instructions here to find the code:



                  https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc645945(v=sql.105)



                  which amounted to:




                  1. In Object Explorer, expand the Management folder.


                  2. Expand the Legacy subfolder.


                  3. Expand the Data Transformation Services subfolder to show packages.



                  D.
                  I right click on it and choose Open. I get this error:



                  enter image description here



                  I should not have to install anything because the person who put this on the machine must have been able to edit it. (this person is completely unavailable so I can't ask him). The reason I need access to it is that we are upgrading the machine.






                  share|improve this answer













                  I almost solved my problem like this:



                  A.
                  I followed the instructions here to decode the encrypted command line:



                  https://blogs.technet.microsoft.com/vipulshah/2007/03/12/how-to-identify-which-dts-package-is-being-called-by-scheduled-job/



                  Which amounted to:




                  1. Copy the DTSRUN line (everything including the DTSRUN)

                  2. Open a Windows Command Line window

                  3. Paste the DTSRUN line into the CMD window.

                  4. To the end of the line, add /!X /!C
                    /!X = do not execute /!C = copy results onto Windows Clipboard

                  5. Run the command

                  6. Open Notepad

                  7. Click Edit>Paste
                    that will paste the actual command into Notepad and it will show the name of the package.


                  B.
                  I observed that the command line looked like this:



                  DTSRun /S "192.168.2.1" /U "sa" /P "changeme" /N "Delete AppErrors"



                  C.
                  Then I follow the instructions here to find the code:



                  https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc645945(v=sql.105)



                  which amounted to:




                  1. In Object Explorer, expand the Management folder.


                  2. Expand the Legacy subfolder.


                  3. Expand the Data Transformation Services subfolder to show packages.



                  D.
                  I right click on it and choose Open. I get this error:



                  enter image description here



                  I should not have to install anything because the person who put this on the machine must have been able to edit it. (this person is completely unavailable so I can't ask him). The reason I need access to it is that we are upgrading the machine.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 19 '18 at 2:42









                  Michael PotterMichael Potter

                  3,89753763




                  3,89753763






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • 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%2fstackoverflow.com%2fquestions%2f53357860%2fview-sql-code-for-job-in-sql-server-management-studio%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







                      這個網誌中的熱門文章

                      Xamarin.form Move up view when keyboard appear

                      Post-Redirect-Get with Spring WebFlux and Thymeleaf

                      Anylogic : not able to use stopDelay()