For example, if table Person has Person_ID, and table Employee also has Person_ID which has a foreign key relationship to Person.Person_ID, then I smart-rename Person.Person_ID, it would be spectacular if Employee.Person_ID was also similarly renamed.3 votes
I wondered if it would be of interest to add an auto formatting profile in line with http://www.sqlstyle.guide
It is a SQL code style guide that I published recently.3 votes
If format SQL makes chnages - it destroy saved marks
This occurs even when line bookmarked line hasnt (visibly) changed
Very frushtrating1 vote
Ability to filter columns in invalid object list1 vote
I'd like to have an toolbar botton to enable / disable the SET STATISTICS IO / SET STATISTICS TIME for the current session similar to SSMS's build in buttons for Show actual execution plan or Show client statistics
Currently I have either to modify the query options or have to type it in manual (or using my "sio"-snippet) which is a little bit annoying.3 votes
Shift+F5 for executing the current statement is awesome, please make it work even when there is an incorrect query elsewhere on the screen.
Shift+F5 for executing the current statement is awesome, please make it work even when there is an incorrect statement elsewhere on the screen.
Semicolons and GOs can be used to separate the statements if needed.4 votes
**BUG** - I ran a smart rename on all of my tables to change from TableName to tblTableName. I did this for ~15 tables and everything looked fine until I ran the code. Many of my stored procedures us cursors, and I found that none of my cursors were updated with the new table names.
SET @myCursor = CURSOR FOR SELECT MyField FROM dbo.MyTable WHERE MyFlag = 1
Run [Smart Rename...] on MyTable to change it to tblMyTable.
Notice that the cursor definition does not get changed.4 votes
Append "SELECT SCOPE_IDENTITY()" for ii (INSERT INTO) fragments if the table contains an IDENTITY column
Suppose I have a table test (Id IDENTITY, Name VARCHAR(20)). Today, when type ii<tab>test<tab> SQL Prompt generates the script
INSERT INTO dbo.test
( Name )
Because the table test contains a column of type IDENTITY, it should instead generate the commands
INSERT INTO dbo.test
( Name )
SELECT SCOPE_IDENTITY()3 votes
Opening over 2500 code objects to set a baseline format, required by a large customer, is a daunting manual task.
Many of Red Gate's tools provide command-line functionality.
Please add it to Prompt so we can bulk (re)format SPs, UDFs, Triggers. Integration into the commit-path (we use SVN) would be ideal for standardized check-ins (Commits).
Can't recall whether a style is exportable... (License key awaited at new employer) Should be able to point to UNC location for the style to use.2 votes
Provide an option to Preserve Whitespace. I like to spread things out for easy visibility:
ON wwwww = uuuuuu
WHERE vvvvvv = eeeeeee
When I run Format SQL it takes out all of my carefully inserted whitespace; please add an option not to do that.1 vote
Just like in Toad and SSMSBoost, there's a facility to create a script such as INSERT based from the given result grid. This would be handy in generating test data or re-populating tables71 votes
It would be great, if I could create custom folders in the SSMS to organize hundreds of tables, stored procedures, views ...6 votes
When coding delete queries it would be useful if there would be a graphically representation of the foreign key relationships of the object you are deleting on.4 votes
Link users to a github repo of snippets where they can clone/contribute/fork as they desire: https://github.com/gvohra/sqlpromptsnippets
A lot of users are asking for more snippets, or ways to share snippets with teams. How about linking people to a public repo on github where they can clone/contribute/fork as they like?
I've just set one up here which has all the Red Gate defaults, plus about 50 key others I have added (like gb = GROUP BY):3 votes
It would be nice to have a TRY CATCH snippet.1 vote
I would like to be able to manager 'tab magic' feature, like dont save the last couple years, or filter it to x monthes, days, etc
implement filter and or manager of tab history. like show the last 2 months or days or whatever. The Manager I could just delete or removed outdated items. I have been using tab history since day 1. when I run it, I feel I have an pulling up too much for program to handle. it takes too long now1 vote
When generating an insert script with default values for a table, use SYSDATETIME() instead of GETDATE() for datetime2 columns. GETDATE(), is fine for datetime columns, but for datetime2 columns, which have a larger precision SYSDATETIME() would be more appropriate.7 votes
The latest Prompt beta will now use SYSDATETIME() for datetime2 and SYSDATETIMEOFFSET for datetimeoffset when generating an INSERT statement. You can find out more and download the beta from https://forums.red-gate.com/viewtopic.php?f=169&t=78627
Hi, I think it would be useful to add support for multiple snippet folders to the SQL Prompt - Snippet Manager. I would use this by connecting to a set share of snippets that our team uses as well as having my own set of snippets that may be useful only to me.
Thanks for considering,
when clicking a table currently we see table structure and columns, please display primary keys and foreign keys that are in this table along with Table name1 vote
What I mean by closest match varies between match types. In the case for camel case (or underscore-separated first letter matching), the closest match would be the one that has the exact initials. Next closest would be ones with additional suffixes, those with prefixes, and then those with intervening content between matched initials. Somewhere in there should be any matches with the search value as a direct substring. For the case of substring matches, an exact match should be first, then matches closest to the beginning of the name should be listed next, sorted by suffix length (or alphabetical for the same match starting position). Matches further from the beginning of the string would then be listed, sorted as above, etc.
Here are a few examples based looking up a table name with the initials of "tcd" (while typing the FROM clause of a SELECT statement):
Note: I've added square brackets around each matching, highlighted letter per the screenshot of the SQL Prompt suggestions.
[list=1]* Closest match (the actual table I was searching for): [t]bl[C]oil_[D]ata
* Suffix to the match: [t]bl[C]oil_[D]ata_New
* Prefix to the match: Original_[t]bl[C]oil_[D]ata
* Match with intervening content: [t]bl[C]oil_Width_[D]ata.
* Mix of prefix and intervening content:
*Content as a direct substring: Temp[T][C][D][/list]
Another example, for a substring match, "stand" with no exact match (if one exists, it should be listed first, of course):
1. tbl[Stand]s (shortest match)
3. tbl[Stand]_Controllers_CVC_Data <-- # 2 and 3 should be listed in alphabetical order (#1 would fall in the proper place that way too, so it might not need special handling)
4. Original_tbl[Stand]_Controllers_AGC_Data <-- These next ones should be listed after 1-3 instead of before them, as happens currently.
Within each type of match, the content could be sorted alphabetically for matches with prefixes and suffixes and from shortest to longest for intervening content (could be number of words instead of total number of characters, one long word like "_temperature_" vs. two short words "_exit_lp_").
What I mean by closest match varies between match types. In the case for camel case (or underscore-separated first letter matching), the closest match would be the one that has the exact initials. Next closest would be ones with additional suffixes, those with prefixes, and then those with intervening content between matched initials. Somewhere in there should be any matches with the search value as a direct substring. For the case of substring matches, an exact match should be first, then matches closest to the beginning of the name should be listed next, sorted by suffix length (or alphabetical for…3 votes
- Don't see your idea?