ISVALIDASOBJECTNAME and QUOTENAME enhancement to clean up script readability - by Greg Low - Australia

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


37
1
Sign in
to vote
ID 796172 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 8/2/2013 7:04:48 PM
Access Restriction Public

Description


SQL Server tools currently provide an option to have all names quoted or for no names to be quoted when generating scripts. The default behaviour is to quote all names.

While the default option works, it leads to scripts that are hard to read. Developers spend large amounts of time removing unnecessary square brackets to improve the readability of scripts.
Sign in to post a comment.
Posted by DaveBolt on 8/19/2014 at 7:55 AM
Hmmm    ... a reserved word OR CONTAINS CHARACTERS NOT USUALLY ALLOWED IN OBJECT NAMES ...
Posted by DaveBolt on 8/19/2014 at 7:53 AM
I agree with having an option to disable square brackets around object names when generating scripts, which greatly diminish readability. Greg's proposal seems sound to me. Although SQL users (i.e. programmers) wouldn't necessarily need to be able to call ISVALIDASOBJECTNAME and QUOTENAME, it certainly won't hurt.

Square brackets of course are only NEEDED when the object name is a reserved word (which would be the exception rather than the rule). Needing them is generated scripts would thus would also be the exception rather than the rule.

A lot of posters on a lot of forums agree with not forcing square brackets upon us when not needed. E.g:

http://dba.stackexchange.com/questions/5721/how-to-turn-off-delimiters-in-generated-sql-scripts-for-data-types-in-sql-server
https://connect.microsoft.com/SQLServer/feedback/details/378725/an-option-to-remove-square-brackets-from-coding
http://stackoverflow.com/questions/675838/why-do-square-bracket-appear-with-the-table-name
http://ask.sqlservercentral.com/questions/1252/disable-square-braces-when-generating-scripts-from.html

Posted by Microsoft on 11/25/2013 at 9:00 PM
Thanks for submitting this feedback. We will evaluate this feature request and get back to you.