Re: What does the .run method return




The short answer is NO.  I say that because your sample executes a VBS
script, not a database stored procedure.  VBS scripts can output text
to a console window or GUI message box.  But, they do not create
output parameters.

However, I am confused by your question.  In one place you reference
'stored procedure', yet your example is a VBS script.  Does your
script connect to a database in which there is a stored procedure?

Personally, I would need to see a snippet of code from that script and
have a better explanation of what exactly you're trying to accomplish
before I could comment further.

Tom Lavedas
===========http://members.cox.net/tglbatch/wsh/

I have a batch job that calls a VBscript. This Vbscript connects to
the database and calls the stored procedure. The stored procedure
takes one input parameter and returns only one row with 2 column. both
the columns are integer.

Please find the code below
Batch job. Call to the VBscript

Dim ret
set ws = Wscript.CreateObject("Wscript.Shell")
ret = ws.run("\\C\Delete_Data.vbs SQL024301 Taurus_ NT NT Config_New 3
0",7,true)
wscript.quit ret

VBscript.. pasting only the main function not all of them

'Main procedure
Sub delete_data

WriteLog "Calling stored procedure
Product_DeleteReqItemResErr ..."

On Error Resume Next
Dim objCmd
set objCmd = CreateObject("ADODB.Command")
' set rs = CreateObject("ADODB.RecordSet")

With objCmd
.ActiveConnection = Scn
.commandtimeout = 9000
.CommandText = "test_Product_DeleteReqItemResErr"
.CommandType = 4
.Parameters.Append .CreateParameter("date_diff_days", 3, 1)

End With
rs = objCmd.Execute

' If Not rs.EOF Then
' outTotalConfigId = rs.Fields(0)
' outTotalBundleId = rs.Fields(1)
' End If

Scn.CommandTimeout = 600
On Error Resume Next

If Err.Number <> 0 Then
WriteLog Err.Description & " (" & Err.Number & ")"
FatalError
End If

On Error Goto 0

WriteLog "Product Config Deletion Success!"
Writelog " Product Config Deletion Exit code is 0 "
Closedown

Wscript.quit 0
End sub

Thanks
Deepal
.



Relevant Pages

  • Re: Looking for data dictionary/definition integrity checking utility
    ... That script could come in handy in some situations. ... (or in a stored procedure using the field). ... >>database, i.e. all table names, field names, etc. ... >>the identifier in each location. ...
    (microsoft.public.sqlserver.programming)
  • Re: composite key question
    ... Each time you do an insert SQL ... it's probably not a stored procedure. ... queries to perform slower, however. ... Seeing as how that script you sent was not a stored proc, ...
    (microsoft.public.sqlserver.programming)
  • Re: Help with SQL 2005 and Sourcesafe 6
    ... I understand where you're coming from but if you open up the .sql script ... stored procedure in the database that it belongs to. ...
    (microsoft.public.sqlserver.tools)
  • Re: Unable to locate job scheduling stored procedures
    ... sp_add_job and all other SQL Server Agent stored procedure exist in the msdb ... database, ... You can fix this by either starting your script with "USE msdb", ...
    (microsoft.public.sqlserver.msde)
  • source text file as input parameter from a stored procedure
    ... I am using an active X script in combination with a global ... transform task that loads data from a .txt file to a table. ... I can also tell that the stored procedure is correctly passing in the ... EXEC sp_OAGeterrorinfo @object, @hr ...
    (microsoft.public.sqlserver.dts)

Loading