dbTalk Databases Forums  

Script Task with SSIS

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Script Task with SSIS in the comp.databases.ms-sqlserver forum.



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

Default Script Task with SSIS - 04-06-2010 , 10:03 AM






I added a script task to my ssis package to check last file modified
in Explorer. Here's the code:

Public Sub Main()
Dim fi As System.IO.FileInfo
Dim ModifiedTime As DateTime


If CInt(Dts.Variables.Contains("User::FileUpdatedActu al")) = 1
Then

fi = New System.IO.FileInfo("\\sb25\downloads$\DataInfo
\DataInfo.txt")
ModifiedTime = fi.LastWriteTime
Dts.Variables.Item("User::FileUpdatedActual").Valu e =
fi.LastWriteTime.Date
Dts.Variables["User::bExists"].value = true
Dts.TaskResult = Dts.Results.Success
Else
Dts.Variables["User::bExists"].value = False
Dts.TaskResult = Dts.Results.Failure
End If


End Sub

I next added the two variables FileUpdatedActual and bExists. In the
script task I'm getting the blue squiggly line under:

Dts.Variables["User::bExists"].value = true

and

Dts.Variables["User::bExists"].value = False

The error message is:

Property access must assign to the property or us it's value. Any
suggestions?

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.