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:

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...