674 results found
-
Formatting Styles - More granular control?
I realize my title is very vague.
Basically, I would like more control options over how styles are applied. Maybe I'm just really weird in how I format my SQL, but it seems like no matter how hard I try, I can never get the styles the way I want them.
I realize that it's impossible to make it perfect. But the basic idea is to get the formatter to do what you would normally do the majority of the time.
For example....the majority of the time, I prefer the following...
For JOIN clauses, all join criteria is in the…
7 votes -
Auto-generate MERGE comparison clauses
One of the most tedious elements of writing T-SQL is handling of proper comparisons in the WHEN MATCHED AND ... THEN UPDATE clause of a MERGE statement.
For example, to compare a single nullable target and destination column you should compare:SRC.column <> TGT.column
OR (SRC.column IS NULL AND TGT.column IS NOT NULL)
OR (SRC.column IS NOT NULL AND TGT.column IS NULL)I'm not sure on exactly how would be best to handle this but it would be great if SQL Prompt could somehow auto-populate these clauses. Or even better would be some way to generate an entire merge statement…
6 votes -
Add "Set as Active Connection" to Registered Servers
This is essentially the same as a forgotten SSMS request over here: https://feedback.azure.com/forums/908035/suggestions/32896039
It would be incredibly useful to be able right-click on a server-node in the Registered Servers list and change/set the connection for the current document window to that. You already have a custom context menu item in there ("Tab Color (Server)", so that hurdle is gone.
This idea is related to these, but not quite the same. In both cases, it seems they don't know about the Registered Server functionality, so they're basically asking for this idea, plus for you to re-implement that entire feature.
https://redgate.uservoice.com/forums/94413/suggestions/40385740
https://redgate.uservoice.com/forums/94413/suggestions/134251351 vote -
Provide the option to create custom rules.
Open the Rules Engine API so that we can create our own organizational specific rules.
For example, I would like to be able to flag datetime, getdate(), getutcdate().
12 votes -
Parentheses positioning not honoured for all parentheses, eg constraints
Using the parentheses option "expanded, to statement" for DDL, I would expect a constraint to appear with the opening parenthesis under the start of the constraint (eg, the "f" in a foreign key constraint) as follows:
MyColumn int not null foreign key references SomeTable ( someColumn )
But it actually appears at the end of the same line as the constraint, and the entire contents are indented from that position:
MyColumn int not null foreign key references SomeTable( someColulmn )
4 votes -
Filter tables, views, etc. on multiple strings
I would like to be able to filter on more than one string in the Object Explorer of SSMS.
For example, I only want to see views that contain “OKDim” or “SSISOK”. Now I can only filter on “OK”, which still results in a long list of views.10 votes -
Remove dependance on USE [dbname] in Query window.
Many time SQL Prompt doesn't work for me because it thinks I use the database mentioned in the last USE statement in the SSMS query window. This is incorrect and confusing since I change the database in the SSMS dropdown without explicit running any USE statement. SQL Prompt should know what database is selected in the dropdown and offer objects from the selected database,
1 vote -
Subquery may return more than one row when filtering on primary key.
At the moment a warning is given "Non-scalar subquery in place of a scalar" when trying to assign a variable to the result of a query filtered by the primary key column. In this case only one result can be returned so the warning appears inaccurate and wrapping the result in a TOP 1 { } ORDER BY statement seems an overkill just to remove the warning. This is kind of a special case however where the subquery contains only one table filtered with "=" on the primary key column, but it is a very common one.
Example:
DECLARE @X…6 votes -
Code Analysis Selection Background Colour
Could we have the ability to change the background colour when Code Analysis detects an issue with the code. My scheme is black background and light coloured fonts. When code analysis detects an issue, the code becomes unreadable. Below has an example:
https://forum.red-gate.com/discussion/86480/code-analysis-selection-background-colour#latest
3 votes -
Add "insert missing aliases" during formatting if desired
When typing SQL aliases are inserted automatically if configured. However when opening existing query from some other source it would be nice to execute an options to add missed aliases based on the same configured rules as with editing.
9 votes -
CTE column list formatted like the columns in the AS list
The columns listed in the CTE are not formatted like the columns in the AS clause. On larger CTE's, the listed columns may be hundreds or characters long so we get
with xx
( a, b, c, d, e, ...) AS
(Select a,
b,
c,
d,
e,
...3 votes -
Add option to check if object exists when creating stored procedure
It would be helpful if you would add an option to check if the objects used in a stored procedure really exist when creating it.
Example:CREATE OR ALTER PROCEDURE [dbo] [SelectFromTableThatDoesNotExist].
AS
BEGIN
SELECT * FROM [dbo] [NonExistingTable];
ENDThe table used in the procedure does not exist, but the procedure can be created without errors. In this case, it would be desirable if SQL Prompt had an option to output an error when creating the procedure.
3 votes -
Suggestion for THIS site
This is a Format SQL request; not for SQL Prompt, but rather for this website. I don't know how many hundreds of examples have been posted where the author spent quite a bit of time formatting an example, only to have the posted code totally bastardized. Have at least a <code> tag that would present the content within the tag in a fixed-width font and not remove leading spaces. I've seen some posts where the poor soul has tried 2-3 times to get their poin t across only to have the presented code rendered in a way that completely loses…
16 votes -
Parse Dynamic SQL Queries if possible
Be able to read through Dynamic Queries and pick up table creation code or any other columns so SQL Prompt will be able to list out the columns in any tables that were created in that sql.
2 votes -
Put DISTINCT Keyword At Top of Suggestions List
Add an option to have the DISTINCT keyword appear at the top of the suggestions list when the first few characters (DIS, DIST) are typed, ahead of any column name suggestions. Nearly every time I type DIS or DIST, I want the DISTINCT keyword and not a column name that begins with the same letters.
1 vote -
A one-click option to minify the selected/entire code
I would like to request a one-click option (or at least an out-of-the-box Format Style) that would minify either the selected line(s) or entire code in the current session.
This would be really helpful when writing a non-dynamic TSQL that will need to be turned into dynamic to save on (VAR)CHAR limit (4000/8000).
Thank you
1 vote -
visual indicator/TAB colour for read-only connection
Ability to set a different TAB colour for read only connections to an instance e.g. to differentiate between connections to primary and read-only secondary in AOAG. This would need to inspect the ApplicationIntent=ReadOnly connection property. n.b. I have tried doing this with a registered server group containing just the one read only server, but it uses the TAB colour defined for that server, not the group, so cannot distinguish whether read-only or not.
2 votes -
Manually define schema/foreign keys
We have a database that has Foreign keys, but doesn't have them set up as such via it's schema. It's a legacy system and there are technical reasons we aren't going to go back in after the fact and define them. I can't imagine we're the only place to ever run into this, it would be nice to have some sort of config file where you could manually set up things like that.
1 vote -
auto alias for colums name
when i join 2 tables with columns having same name sql raise the error 'Ambiguous column name'. if it possible i think it is usefull to have an auto alias generator. example:
select a.name, b.name from a join b => select a.name as aname, b.name as bname3 votes -
Allow for Tab History search with date / server criteria
I use Tab History daily and have come to rely on it to find queries that I thought I was only going to need one time, but end up needing again. It would be great if you could use other things to search instead of just keyword. I would like to be able to select a date or date range (for example, I know I ran that query last month, or 3 months ago) and server (we have multiple servers with the same data sets so it would be nice to be able to filter to the server you know…
8 votes
- Don't see your idea?