I have created a BAT file to run a procedure that, in turn, creates another BAT file based on the tables within the database.
This was working locally with no issues.
I have now logged onto the database server, and have tried to execute the first BAT file, but obtain the following error:
Msg 3623, Level 16, State 1, Server S3-TEST-DB, Procedure CreateBATScriptForStoreExtrapolation, Line 141
A domain error occurred.
I have tried using both a trusted connection and also a SQL Server sa account.
The file is actually created (as it contains the error message), but it appears I cannot execute the procedure from the BAT file?
Is this correct and if so, what can I do to rectify the situation?
Thanks
Domina error when trying to execute BAT file on SQL Server
Moderator: DosItHelp
-
- Expert
- Posts: 80
- Joined: 04 Feb 2009 10:03
This seems to me like you're trying to run a DOS script from a MS SQL Server job.
If that's the case, make sure you're calling the DOS script like the following:
I think that might help you get what you're looking for.
PS: You might want to do a Set NoCount ON then OFF before and after those commands unless you're looking for the feedback from those jobs.
If that's the case, make sure you're calling the DOS script like the following:
Code: Select all
Exec master..xp_cmdshell '\\Server\Folder\ScriptName.bat'
I think that might help you get what you're looking for.
PS: You might want to do a Set NoCount ON then OFF before and after those commands unless you're looking for the feedback from those jobs.
Last edited by RElliott63 on 25 Mar 2009 21:07, edited 1 time in total.