Thursday, October 14, 2010

String Handling Functions - Part 1 By Andy Warren

In this video, within 6 min. 29 secs Andy not only shows the usage of Lower, upper, left, right, ltrim and ltrim functions but also displays a few what if scenarios which we may otherwise not think about if we just go by the book.

Here are my learnings:
  • upper and lower functions does not return an error when used with null data.
  • The second argument for left and right functions should be a positive value and cannot be a negative value.
  • If a negative value is used the select statement errors out.
  • If a zero is used as the second argument it does not return an error but it just returns a blank row.
  • There is no trim functions. If you need a trim function in sql then combine the ltrim and rtrim functions to get the desired result. Eg: rtrim(ltrim(@test))

No comments:

Free Power BI Classes for Week 7 (Last)

Just completed the last class of the F ree  P ower BI  classes of this series.  Today we have covered Adding a canvas background Adding Imag...