Solved

SSIS 2012 dts.variable not declared

Posted on 2014-02-21
4
1,070 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 66

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 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