Escaping In Expressions

by Darren Green 30 Oct 2008 17:18

The expressions language is a C style syntax, so you may need to escape certain characters, for example:

"C:\FolderPath\" + @VariableName

Should be
"C:\\FolderPath\\" + @VariableName

Another use of the escape sequence allows you to specify character codes, like this \xNNNN, where NNNN is the Unicode character code that you want. For example the following expression will produce the same result as the previous example as the Unicode character code 005C equals a back slash character:

"C:\x005CFolderPath\x005C" + @VariableName

For more information about Unicode characters see http://www.unicode.org/charts/

Literals are also supported within expressions, both string literals using the common escape sequence syntax as well as modifiers which influence the handling of numeric values. See the "Literals (SSIS)":http://msdn2.microsoft.com/en-US/library/ms141001(SQL.90).aspx topic.

Using the Unicode escaped character sequence you can make up for the lack of a CHAR function or equivalent.

Currently rated 3.8 by 6 people

  • Currently 3.833333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags

CategoriesScripting

Add comment




  Country flag
Click to get a new captcha Please enter the code

* Required fields. Your email address will not shown, check the preview for what you see. We use it to send you notifications on new comments if you ask us to below. biuquote
  • Comment
  • Preview
Loading




Welcome to SQLIS.com our free SQL Server Integration Services (SSIS) resource site.

MVP

RecentComments

Comment RSS