I am trying to build a utility to run a stored procedure from a simple VBScript. I believe the SQL procedure is running but I can't figure out how to display the return value that the procedure returns. When in SQL, the procedure returns a 0 if it executes properly. I can't figure out what I need to do to display that return value in a MsgBox. The script will be a utility that I can give a non-SQL admin to run in the off-hours . Here's my code:
conStr="driver=sql server;server=MyServer;database=MyDB;uid=sa;pwd=********" 'This is my connection string
Set cmdObj=createobject("adodb.command")
With cmdObj
.activeconnection=conStr
.commandtype=4
.commandtext="ResyncDBSP" 'This is my SP name
.execute 'The SP will be executed after this statement
End with
WScript.Quit
Can this be done?
Thanks in advance!
conStr="driver=sql server;server=MyServer;database=MyDB;uid=sa;pwd=********" 'This is my connection string
Set cmdObj=createobject("adodb.command")
With cmdObj
.activeconnection=conStr
.commandtype=4
.commandtext="ResyncDBSP" 'This is my SP name
.execute 'The SP will be executed after this statement
End with
WScript.Quit
Can this be done?
Thanks in advance!