Solved

SSIS 2012 dts.variable not declared

Posted on 2014-02-21
4
969 Views
Last Modified: 2016-02-10
Hi All,
I am migrating an existing package, working packages, from SQL2005 to SQL2012.
I have variables that are passed/used in a Script Task.  My problem is the Dts.Variables statement does not recognize the "dts.".
Says it's not declared.  I don't understand why it works find on my production server (SQL2005) and not here.
I also tried finding the assemblies needed and one article mentioned Microsoft.SqlServer.ScriptTask; but I can't find this.

Below is the my first problem string....
Dim File_Name$ = DTS.Variables("User::DB_File_Name").Value.ToString

Any help would be greatly appreciated it.
Thanks,
John.
dts.error.png
0
Comment
Question by:Thunder724
  • 3
4 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39877382
Make sure User::DB_File_Name is listed in either ReadOnlyVariables or ReadWriteVariables, then..

Dim File_Name as String
SET File_name = DTS.Variables("DB_File_Name").Value.ToString
0
 
LVL 4

Author Comment

by:Thunder724
ID: 39877515
yup, they are.  Exact same project that is working on the other box.
0
 
LVL 4

Accepted Solution

by:
Thunder724 earned 0 total points
ID: 39877567
Think I got it.
I needed to add the following to the class of the file......

'ScriptMain is the entry point class of the script.  Do not change the name, attributes,
    'or parent of this class.
    <Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute()> _
    <System.CLSCompliantAttribute(False)> _
    Partial Public Class ScriptMain
        Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
0
 
LVL 4

Author Closing Comment

by:Thunder724
ID: 39888299
I figured the problem out.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question