Solved

SSIS 2012 dts.variable not declared

Posted on 2014-02-21
4
885 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
Comment Utility
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
Comment Utility
yup, they are.  Exact same project that is working on the other box.
0
 
LVL 4

Accepted Solution

by:
Thunder724 earned 0 total points
Comment Utility
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
Comment Utility
I figured the problem out.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now