-1

I have requirement to run a SQL query on specific time daily and generate an output file. I'm already using bcp tool inside query to generate report. But, problem is, script is not generating output until I ran it using below command. So, problem is, it is prompting for password each time. So, anyone suggest me to avoid this and pass the password at same time. So that, I can create one batch file to run automatically to avoid user interaction.

runas /netonly /user:domain_name\username "sqlcmd -S dbServerName -i C:\Users\Script.sql"

Ravi
  • 30,829
  • 42
  • 119
  • 173

1 Answers1

0

If you are able to use a 3rd party tool, you can check this out. I've had success with it in the past.

RunAs command line utility

Hope that helps

Spock
  • 4,700
  • 2
  • 16
  • 21