all groups > sql server dts > january 2007 >
You're in the

sql server dts

group:

help with activex script plz


help with activex script plz TG
1/8/2007 7:50:37 AM
sql server dts:
hi!

I have a DTS package in which I am running validations on claims. If
they pass they get inserted into xstaging table, if they don't they get
placed into a hold table.

If the validation passes I want to check if there threshold >= 3% and
if so I want do not want to insert the records that pass validation
into the xstaging,I just want to end the pass branch there.

If threshold < 3% I want to insert the passed records into the xstaging
table.

I have the following as the activex script:

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()

'Const DTSSQLStgFlag_UseTrustedConnection = 256

Dim oConn_threshold
Dim oConn_input
Dim sFilename
Dim oConn_threshold_pass
Dim cn
Dim cmd
Dim rs
Dim Package

Set Package = DTSGlobalVariables.Parent
Set cn = Package.Connections("Load_claims_TEST")
set rs = CreateObject("ADODB.Recordset")
set cmd = CreateObject("ADODB.Command")
Set oConn_input = DTSGlobalVariables.Parent.Connections("Text File
(Source)")
sFilename= oConn_input.DataSource
Set oConn_input = Nothing



'execute stored procedure to run threshold

oConn_threshold.Execute =
"ases_mi60_source.dbo.threshold_calculation_claims"

if oConn_threshold.Execute = "SELECT threshold FROM Load_Summary
where threshold >= '3.00' and @p_filename=sub_filename" then
MsgBox "The threshold is" & oConn_threshold & "and failed"
oConn_threshold.Close
Set oConn_threshold = Nothing
Main = DTSTaskExecResult_Failure
Exit Function

else

oConn_threshold_pass.Execute
"ases_mi60_source.dbo.add_xstaging_claims_test"
MsgBox "The threshold is" & oConn_threshold_pass & "and passed"
oConn_threshold_pass.Close
Set oConn_threshold_pass = Nothing
Main = DTSTaskExResult_Success
End if

cn.Close
End Function



I'd appreciate any help on how to achieve this.

Thank you!

T.
Re: help with activex script plz Allan Mitchell
1/8/2007 7:33:51 PM
Why are you doing this through script? This looks like a simple SELECT
query with a variable parameter. If this is the case then you simply
need two Data Pump tasks to make this work. One testing for > threshold
and the other testing for within threshold.

--


Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com




[quoted text, click to view]
AddThis Social Bookmark Button