Wednesday, November 03, 2010

Quotename Function in SQL

I have learned something very basic today from the sql share video today. It is about the Quotename TSQL function. This function I think is hardly used and hence some of the developers may not be aware of this. Hence I thought I will put my learning about this function here.
  • Quotename function returns the string along with the delimiters added in the function.
  • This function can be used if you are using the delimiters repeatedly.
  • If you are using delimiters on an ad-hoc basis you can just use something like select "-" +@variable +"-"
  • One requirement for using this funciton is that the string cannot be more than 128 characters long as depicted in Andy's video

Thanks to Andy Warren who explains the various ways of using the quotename function in this video.

No comments:

Power BI Did You Know -- Series 1 (Contact Us button)

Did you know that you can add a contact us button in your Power BI reports ? Here is how you add a contact us button in your power bi rep...