dbTalk Databases Forums  

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

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How can i call a stored procedure in an activex script... in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ajay Garg
 
Posts: n/a

Default How can i call a stored procedure in an activex script... - 11-07-2003 , 01:01 PM






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\RawDat aFiles\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

Ajay Garg

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How can i call a stored procedure in an activex script... - 11-07-2003 , 01:28 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

"Ajay Garg" <ajayz90 (AT) hotmail (DOT) com> wrote

Quote:
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\RawDat aFiles\FTP_HandTools\SAP40
\adrc_chng.txt"
Quote:
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

Ajay Garg



Reply With Quote
  #3  
Old   
Ajay Garg
 
Posts: n/a

Default Re: How can i call a stored procedure in an activex script... - 11-07-2003 , 04:16 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

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
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

"Ajay Garg" <ajayz90 (AT) hotmail (DOT) com> wrote in message
news:d9477327.0311071101.130c6a09 (AT) posting (DOT) google.com...
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\RawDat aFiles\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

Ajay Garg

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How can i call a stored procedure in an activex script... - 11-08-2003 , 11:52 PM



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


"Ajay Garg" <ajayz90 (AT) hotmail (DOT) com> wrote

Quote:
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

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

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

"Ajay Garg" <ajayz90 (AT) hotmail (DOT) com> wrote in message
news:d9477327.0311071101.130c6a09 (AT) posting (DOT) google.com...
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\RawDat aFiles\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

Ajay Garg



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.