Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

Once upon a time this blog was a hive of activity. Now however its pretty lifeless as you can probably tell so if are pining for more of the same you can find me over at http://sqlblog.com/blogs/jamie_thomson. I look forward to seeing you there!

SSIS: What does the 1252 in (DT_STR, X, 1252) mean?

When casting to a non-unicode textual value (i.e. DT_STR) in SSIS you might often have seen something like the following:

  • (DT_STR, 50, 1252) (<expression>)

and wondered what on earth the 1252 was referring to. Well the SSIS documentation on MSDN tells us that that third parameter is the code page to be used for the cast but we may still still left wondering what on earth a code page actually is and why 1252?

The answers are provided by SQL Server MVP Erland Sommarskog (via Tibor Karaszi’s blog) at Code page backgrounder, courtesy of Erland Sommarskog.

Hope that helps.

-Jamie

Published 08 November 2008 10:10 by jamie.thomson

Comments

 

Gareth said:

Jamie,

I don't know who is showing their age more - me by being surprised that anyone would not know the magic number 1252 as a codepage, and what a codepage is, or you by living in a mainly post unicode era.

SQL Collation is also codepage-centric, where 1252 gets the prestigious "CP1" alias.

Not sure what happens if you pass CP1252.

Gareth

November 10, 2008 11:27
 

Howard said:

Hi Jamie,

This is a comment. I think you can solve this problem, it took me days still didn't figure out the solution. As i don't the way to post a question to you so i used the comments channel.

Problem:

SSIS package failed many times.

Reason:

data type conversion. I used the expression "01/01"+right(columnName,4) to make up a date. It is working fine even the columnName has null value. However, there are blanks in some of the columnName.

At first i thought it is spaces, even using the expression substring(columnName,1,1)=" ", it won't return ture. So, i am guessing it contains special characters such as tab, etc. Of course, the expression "01/01"+right(columnName,4)" will have data conversion problem if columnName contains special characters.

Question:

How to detect special characters in SSIS expression lang? What is the proper solution to handle such situation?

If other readers read this can they email me their thoughts?

Thanks.

November 17, 2008 23:37
 

jamie.thomson said:

Howard,

Afraid I don't understand the problem. Could you answer 2 questions:

What error are you getting?

What value is it failing on?

FYI: The escape character in SSIS is a backslash (\). The escape sequences are listed here: http://msdn.microsoft.com/en-us/library/ms141001.aspx

-Jamie

November 18, 2008 09:18
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems