Solved

SSIS ScriptTask:  How to do UpperCase(StringVariable)

Posted on 2008-10-28
4
1,265 Views
Last Modified: 2013-11-10
Hi All

In an SSIS Script Task I'm trying to convert a string variable to upper case.

This line --> ConName.ToUpper <> "FRAMEWORK"  <-- returns the below compile error

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at Initialize Connections: The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated.
 (Microsoft.DataTransformationServices.VsIntegration)


This line --> UPPER(ConName) <> "FRAMEWORK" <-- returns 'Name 'UPPER' is not declared.

Thanks in advance.
Jim
0
Comment
Question by:Jim Horn
[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
  • 2
4 Comments
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22823101
Usually the Script Task will underline your error, just like VB.net. Anything underlined?
Paste the Script Task code here so Experts can review. Thanks.
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 250 total points
ID: 22823112
Check this fix:
http://www.microsoft.com/downloads/details.aspx?familyid=2BA43893-EF6B-4019-9E7D-D8CC6C7B905D&displaylang=en

If not, check this:
http://support.microsoft.com/kb/953752/en-us

If not resolved yet, go to script task and make BUILD

helped?
regards!
0
 
LVL 17

Assisted Solution

by:HoggZilla
HoggZilla earned 250 total points
ID: 22824031
Make sure you have the string variable declared in the ReadWriteVariables property of the Script Task Editor. Make sure it is the correct name of your string varialbe and that your string variable has a Scope of the entire package, or at a minimum, the Scriipt Task.
Make sure the string variable has a value, at least a default value for compiling. I am not absolutely sure this is required, but does not hurt and removes the issue.
Here is a sample script task that worked for me.

Dim ConNameAsIs As String = Dts.Variables("MY_VARIABLE").Value.ToString
MsgBox(ConNameAsIs, , "As Is")
Dim ConName As String = Dts.Variables("MY_VARIABLE").Value.ToString.ToUpper
MsgBox(ConName, , "UpperCase")
 

script-task-variables.bmp
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS SQL Sever Import/export problem 7 51
sql server cross db update 2 20
getting error while running below query  in sql 2 16
What Is an Error? 2 27
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

726 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