문제

How can i trigger an SQL job from a bat file?

I will need to input my credentials: user and password, the bat file will be sitting on the server and i want folks to execute bat by double click over windows explorer.

도움이 되었습니까?

해결책 3

Got it.

Cheers guys. sqlcmd -Sxxxx -Uxxxx -Pxxxx -dxxxx -Q"exec msdb.dbo.sp_start_job xxxxxx"

다른 팁

SQLCMD is what you need. SQLCMD /?

CD C:\Program Files\Microsoft SQL Server\100\Tools\Binn

osql -S “[SQL SERVER NAME]” -E -Q”exec msdb.dbo.sp_start_job ‘[SQL JOB NAME]‘”

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top