October 16, 2003 at 11:03 am
I am trying to distribute a stored procedure to the master database on all servers using the ISQL command at the DOS prompt where the stored procedure is. I wonder if someone could help me with the correct syntax of the isql command. Thank you! I don't mind doing one server at a time. But any automation suggestions would also be greatly appreciated.
October 17, 2003 at 11:33 am
Here is the command I came up with:
isql /S servername /U sa /P password /Q "exec sp.sql"
I am getting: Could not find stored procedure 'sp.sql'.
Did I miss something? I am executing the command in the directory where the sp.sql exists. How do I execute that stored procedure against the target server? Any assistance would be appreciated. Thank you.
October 21, 2003 at 11:37 am
HELP! HELP!
October 22, 2003 at 6:18 am
In your example you are trying to run the procedure not create it. What you need to do is create a text file containing the create procedure and associated details (could extract from existing database first) then you can use isql
isql /S SERVERA /U username /P password -d database -b /m-1 /i textfilename
if ERRORLEVEL 1 pause
isql /S SERVERB /U username /P password -d database -b /m-1 /i textfilename
if ERRORLEVEL 1 pause
isql /S SERVERC /U username /P password -d database -b /m-1 /i textfilename
if ERRORLEVEL 1 pause
this will process the textfile (list of sql) in each server and stop if error occurs (pause).
This is how I control all my procs across my servers. ie using .bat file
Far away is close at hand in the images of elsewhere.
Anon.
October 23, 2003 at 5:30 pm
Thank you, David, for the helpful instructions. It worked!!!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply