The quote_character in QUOTENAME function


The the quote_character is defined as one character but it seems to work when you put both brackets. It will take only the first one and it will work either left bracket or right bracket. The default for the quote_character is [.

  

  declare @name varchar(10)='Test Name'

 select  
 QUOTENAME(@Name,'('), 
 QUOTENAME(@Name,')'),
  QUOTENAME(@Name,')('), 
 QUOTENAME(@Name,'()'),
  QUOTENAME(@Name)
 

 

https://msdn.microsoft.com/en-us/library/ms176114.aspx?f=255&MSPPError=-2147217396

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s