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:

Step By Step Guide to resolve SQL server connection issues when connecting from R Studio

Yesterday I tried using a couple of  RevolveScaleR functions -- RxSqlServerData and RxImport.in Rstudio.  These are my learnings as part of ...