Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Run batch file from SQL

Do it like the picture: like this image. Attention:
https://stackoverflow.com/questions/54862309/run-batch-file-from-sql/71397512#71397512
The drive containing the batch file should be other than the C drive, to avoid trouble.
Add execute, read and write permissions for the user, which you are using to run the batch file, to get the username run this query: EXEC master..xp_cmdshell 'whoami', get the name after the  sign. , for example "nt servicemssqlserver", add permission for this user: mssqlserver
Finally make sure you put the batch file on the same server as where you execute your Job.
 
PREVIOUS NEXT
Tagged: #Run #batch #file #SQL
ADD COMMENT
Topic
Name
9+5 =