Solved

SSIS ScriptTask:  How to do UpperCase(StringVariable)

Posted on 2008-10-28
4
1,241 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
  • 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

789 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