0

Could anyone please help me to understand this code under SQL-Server Job steps. One of the step having this process and I am not getting its process behavior with Type - "Operating System (CmdExe)" and Run-as - "SQL Server Agent Service Account".

enter image description here

Also, What is the actual role of these Type & Run-as in option?

Irfan
  • 665
  • 6
  • 29
  • The image you have in your question is not available... You just edited it to an invalid link. Any reason? – TT. Jun 03 '19 at 06:03
  • @TT.: There was having sensitive information in image! – Irfan Jun 07 '19 at 07:21
  • Do you realize that people can still browse through previous version of your question, to see the images you removed? If people see the link is invalid, they may just browse through previous version to see what the image was about. If you want to remove them permanently, it's probably best to flag your question for moderator intervention and ask for the links to be removed from previous versions as well. Also, be careful when posting images about situation involving your employer. – TT. Jun 07 '19 at 07:40
  • Another way is to remove the images from your question entirely, and change the wording of your questions to no longer refer to those images. If you do, make sure your questions are still sensible without those images. – TT. Jun 07 '19 at 08:18

1 Answers1

1

Run as defines the proxy account to be used to run this step. Proxy accounts defines a security context in which this job step runs. Each proxy corresponds to a security credential. For example, if you try to execute a copy command with CmdExec type, you must use a credential (e.g. Windows user account) that has rights to read the source file and rights to write in the destination folder.

Job steps can be different types:

  • Executable programs and operating system commands.

  • Transact-SQL statements, including stored procedures and extended stored procedures.

  • PowerShell scripts.

  • Microsoft ActiveX scripts.

  • Replication tasks.

  • Analysis Services tasks.

  • Integration Services packages.

Each type is executed differently. T-SQL scripts are sent to the database engine, executable programs (CmdExec) starts external programs (e.g. copy to copy files, or DTSRun to run a DTS package outside of SQL Server, as in your example), etc.

Andrey Nikolov
  • 12,967
  • 3
  • 20
  • 32
  • Thanks for the detailed explnation but Could you please tell what exactly code is doing? I know its wierd to ask may be! but I can say it is not executing any package here nor any SP in that. – Irfan Jan 17 '19 at 08:36
  • It runs package with name specified after `/N` switch, connecting to the local server (`/S`) using Windows Authentication (`/E`). – Andrey Nikolov Jan 17 '19 at 08:43