Tuesday, December 9, 2014

Learning Every Day: Case Sensitive Replace

During some T-SQL programming I needed to add spaces before some characters within a string.
The problem was that characters were in upper and lover case and I had to preserve their cases.

Idea for the solution was found in "stackoverflow.com".

Here is how it can be done:

SELECT REPLACE('1C2c3' COLLATE Latin1_General_CS_AS, 'C', ' C');
SELECT REPLACE('4C5c6' COLLATE Latin1_General_CS_AS, 'c', ' c');

And here is the result:

--------
1 C2c3
--------
4C5 c6

The trick is in using "Latin1_General_CS_AS" case sensitive collation to do the replace.

You can also use that method for a search. For example two queries below will return different results:

SELECT CHARINDEX('C', '1C2c3' COLLATE Latin1_General_CS_AS);
SELECT CHARINDEX('c', '1C2c3' COLLATE Latin1_General_CS_AS);

Sunday, December 7, 2014

Pictures from SQL Saturday #347 in DC

Here are picture from actual SQL Saturday #347 in DC.

SQL Saturday happened in Microsoft building in Chevy Chase, Maryland.


At first I was greeted by brave team of volunteers at the reception desk.
They gave me a wonderful "SQL Saturday #347"  coffee cup.

My first session was with Allen White about "Realtime ETL with Service Broker"  if you are interested, you can download it here.

While other rooms were packed, our room was half empty on another side of the hallway. 

Attendees are waiting for the next session.

Speakers' room


Sponsors





  My second session that day was with Reeves Smith. He was talking about "Evaluation Context with DAX, the Language of PowerPivot".







I did not make a lot of pictures on that event because I had my own session and had to be prepared well.
So, here are pictures from the closing ceremony.














Organizers claim that there were about 250 attendees. Biggest SQL Saturday in DC so far.
First-timers are rising their hands.

Raffling. Lucky winners.


























Last set of pictures is from after event party