I created a batch file and put the following line in it:
runas /user:internal\c39293 "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -E -S WLDZ9454 -d ChadDb -Q "usp_Test"
I tried to run the usp_Test stored procedure on the server WLDZ9454 against the ChadDb database.
When I execute it, I just get information about the parameters of the parameters, about the error of the error, so it is not clear to me what I'm doing wrong.
Please note that when I run the code minus the code that tries to run under different credentials, it works:
"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -E -S WLDZ9454 -d ChadDb -Q "usp_Test"
Chadd source
share