Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Dts is not declared Error in Script Task Editor Expand / Collapse
Author
Message
Posted Thursday, June 27, 2013 12:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 27, 2013 12:16 PM
Points: 2, Visits: 2
Hi All, When I was trying to write some script in Script Task Editor it is showing "Dts is not declared" error. Can any one help me to sort out this problem.

Here I have provided my code for your reference.

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime


Public Class ScriptMain


Public Sub Main()
Dim dayofweek As String = String.Format("[0]dddd", DateTime.Now)
Dts.Variables("User::DayOfWeek").Value = dayofweek
Dts.TaskResult = Dts.Results.Success
End Sub

End Class
Post #1468288
Posted Wednesday, July 3, 2013 7:20 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 11, 2014 8:55 PM
Points: 918, Visits: 491
Can you try using this.variable("VariableName").value instead of dts? Also, is your variable listed in ReadWriteVariables section of the task?

Post #1470045
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse