Solved

SSIS ScriptTask:  How to do UpperCase(StringVariable)

Posted on 2008-10-28
4
1,205 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 and will be exposed to the many uses the SELECT statement has.

728 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

10 Experts available now in Live!

Get 1:1 Help Now