March 2011 - Posts

This is mostly one of those “retweet"-posts”, since the publication of the new exams are yesterday’s news (literally it was published on March 30th).

Both fellow bloggers Steef-Jan and Mick Breeze has posted on it and Steef-Jan points out the new parts of the exam. Check out the page here.
(Update 2011-04-01) Be sure to read Steef-Jan's later post about available resources about what to learn before taking the test.

The BRE has been made less important as the exam has the new section: “Implementing Capabilities” that includes RFID (does anyone besides K-mart use that?), EDI and BRE.

Also, there is a new section about WCF and it’s adapters.

Interestingly; nothing is mentioned about AppFabric integration. I find this strange, since it is an obvious stepping stone towards integrating with cloud based services. Also: there is nothing about integrating cloud based services… My theory is that these services are still in a kind of beta stage and are subject to change.

Now to find some reading material as well as certified examiner.

The problem

To quote the online help: “…excluding trailing blanks”.

The issue

I was writing some position based datastrings using SQL server and was continually using the Len function to evaluate the total length of the string. This is a useful technique when the total string length is about 660 positions.

Sometimes when I used Len I got strange results. The strings where much shorter than they where supposed to be.

This was, as I noticed, down to the len-function ignoring trailing blanks. *sigh* SQL server did that thing again that gives me a headache.


select len(‘ ’) –- returns 0
select len(‘ X’) –- returns 2
select len(‘ X ’) –- returns 2

A solution

A useful solution to this problem is given in the books online article: replace the blank, using the CHAR-function when evaluating the string length:

LEN(REPLACE(' x ', CHAR(32), '_')) -– returns 3

A better solution

A better and simpler solution was provided by commenter "iain", thanks! Simply use the DATALENGTH-function instead.

select DATALENGTH(‘ ’) –- returns 1!
select DETALENGTH(‘ X’) –- returns 2
select DATALENGTH(‘ X ’) –- returns 3!