Stop deleting parenthesis I type
If I edit a statement like SELECT COALESCE(x, y, z) and then add some parenthetical as in LTRIM(COALESCE(x, y, z)), the last parenthetical is deleted by SQL Prompt even though I typed it. Two options are to 1) correctly establish parenthesis or 2) stop deleting characters I type correctly
This is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
Daniel White commented
Something similar used to happen with quotes. For example: I use SQL queries to write SQL queries a lot. Suppose I want to change all databases from FULL to SIMPLE recovery model. I do it for one database using SSMS's Object Explorer and have it generate me a script; it gives me:
ALTER DATABASE [AspNetDB] SET RECOVERY SIMPLE WITH NO_WAIT
I want to do it for all databases, so I put the alter statement in a string and put it in a select statement:
SELECT 'ALTER DATABASE [AspNetDB] SET RECOVERY SIMPLE WITH NO_WAIT' FROM sys.databases;
Then I select the database name AspNetDB and type:
' + name + '
The result I want is:
SELECT 'ALTER DATABASE [' + name + '] SET RECOVERY SIMPLE WITH NO_WAIT' FROM sys.databases;
The result I get is:
SELECT 'ALTER DATABASE [' + name + ''] SET RECOVERY SIMPLE WITH NO_WAIT' FROM sys.databases;
Thankfully, this has been fixed in a recent version; all I have to do is go to SQL Prompt / Options / Inserted Code / Special Characters and turn off the option Closing Characters / Single Quotation Mark. In earlier versions, I used to have to go to SQL Prompt / Options / Behavior and turn off the option Suggestions Box / Display Code Suggestions, and that made me lose intellisense.
However, going to SQL Prompt / Options / Inserted Code / Special Characters and turning off Closing Characters / Parenthesis doesn't help Bob's example. Turning off that option should do the trick, but it doesn't.