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 Online -- Week 1

Today I have started free Power BI classes These classes are aimed at people who are new to Power BI.  I will be covering the Dashboard in a...