all groups > sql server dts > november 2003 >
You're in the

sql server dts

group:

How can i call a stored procedure in an activex script...



How can i call a stored procedure in an activex script... ajayz90 NO[at]SPAM hotmail.com
11/7/2003 11:01:28 AM
sql server dts: I have written an activex script to disable a data transform task when
the file size is zero and put it in the work flow properties ti not
run a task of uplaod if the file size is zero.

The script is as given below..


Function Main()
Dim fso
Dim f
Dim FileName

' file to check for a zero-byte length
FileName = "\\nbcprddb2\groupsdw\NBC_IM_Data\DataFiles\RawDataFiles\FTP_HandTools\SAP40\adrc_chng.txt"

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(FileName)

' if it's zero bytes, don't import it or the import
' will fail
If f.Size = 0 Then
Main = DTSStepScriptResult_DontExecuteTask
Else
Main = DTSStepScriptResult_ExecuteTask
End If

Set f = Nothing
Set fso = Nothing
End Function

I also want to intimate the dba that the file size is zero..either by
executing xp sendmail or by using the send mail functionlity of dts if
the task does not execute.How do I get this done if the task is not
executed when the file size is zero.


Thansk

Re: How can i call a stored procedure in an activex script... ajayz90 NO[at]SPAM hotmail.com
11/7/2003 2:16:32 PM
Thanks Allan... for yor response but I am a newbie to VB scripting.I
had read your article in context to this problem but could not think
up the specificts as to how to implement this in this particular
case.I specifically do not get how i can define a sub in the gloal
main procedure .....again having done this ...where should i define my
global variables and how should i treat it in the work flow...

I apologise butI am a back end guy and have just been able to piece
together this bit..I found scripting usefulbut am not able to proceed
as i am new to the lnguage...would be obliged if you could guide mt
hrough the steps.


Thanks

Ajay

[quoted text, click to view]
Re: How can i call a stored procedure in an activex script... Allan Mitchell
11/7/2003 7:28:49 PM
Change the placement of the "File size is Zero Logic to incorporate this

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218)

you disable/enable each flow as necessary

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]
"\\nbcprddb2\groupsdw\NBC_IM_Data\DataFiles\RawDataFiles\FTP_HandTools\SAP40
\adrc_chng.txt"
[quoted text, click to view]

Re: How can i call a stored procedure in an activex script... Allan Mitchell
11/9/2003 5:52:59 AM
Using the article.

As the first step you have the checker for file size.
You have your step where you proceed coming off that using an on success
constraint.
If the file size is 0 then you disable the following step and the package
will exit gracefully having only done 1 step.



--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

AddThis Social Bookmark Button