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:

My Microsoft MVP Award

At the beginning of this month, I received an email from #microsoft telling me that I have received the Most Valuable Professional (MVP Awa...