275 results found
-
Turn a stored procedure into a script (for testing)
When testing stored procs it's sometimes (or often) required to get the inside of the sproc and test it as a plain script. It would be helpful if SQL Prompt had an option to click a sproc and enable the coder to script it as a script with the input variables declared as plain variables at the head of the script (with maybe default values filled in already). It's something similar to taking script code and making it into a sproc but... the other way round :) It would make life easier for many a dev... Thanks!
27 votesThis feature was released in version 7.3 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team -
Ability to flip the sides in an auto generated join clause
When I write a join statement I put the last table that I am joining to the other tables on the left side of a join clause. For example:
SELECT *
FROM tblOrder o
INNER JOIN tblIOrder_Detail d
ON d.OrderID = o.OrderID
The auto-generated join clause would be "ON o.OrderID = d.OrderID". It would be nice if it was possible to customize this behaviour to choose which side there will be each table/alias on.Thanks
27 votesWe’ve released SQL Prompt 6 which includes an option to swap the order of columns in join clauses.
-
Format CTE
Allow users to specify how CTEs should be formatted. Right now I get:
WITH cte
AS (
SELECT
Title
,FirstName
,LastName
FROM
isales.dbo.salesteam
)
SELECT
Title
,FirstName
,LastName
FROM
cteWhat I would like is:
WITH cte
AS
(
SELECT
Title
,FirstName
,LastName
FROM
MyTable
)
SELECT
Title
,FirstName
,LastName
FROM
cte26 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Disable SQL Prompt on certain databases
In previous versions of SQL Prompt, I could tell it to ignore certain databases for generating intellisense. We have a couple of databases that are causing issues with the product when it attempts to load the schemas. I would like to have the ability to turn off SQL Prompt for certain databases back.
26 votesSQL Prompt 6.1 has now been released which includes an option page for filtering server and database connections.
-
Automatically generate the GROUP BY column list from the SELECT list
Typically, the GROUP BY column list is exactly the same as the SELECT list except the aggregates and any constants included. I usually wind up using a copy & paste, which is always a hassle, especially if it is a complex query. It always seemed to me that the GROUP BY list should be optional in the SQL standard. But short of a standard change followed by implementation changes, it would be nice to at least have it defaulted for me.
By the same token, the HAVING statement could (optionally) prepopulate with (one of) the aggregate(s) from the select list.…
25 votesThis is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Warning on delete and update statements if no WHERE clause is specified
It would be nice to get a warning on delete or update statements if you did not specify a where clause.
23 votesSQL Prompt 7.2 displays execution warnings before executing DELETE or UPDATE statements without a WHERE clause. You can download the latest version from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Change formatting of IF statements.
When an IF is short and does not have a BEGIN END on it, have it format to a single line.
Right now if you have
IF @Parameter1 = 0
RETURN -1
IF @Parameter2 = 0
RETURN -2I would like it to be:
IF @Parameter1 = 0 RETURN -1
IF @Parameter2 = 0 RETURN -2which would make it more compact.
23 votesThis feature was released in version 8 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team -
Intellisense for system stored procedures
I just needed to re attach a database from a single mdf file. Something I do every 6 months or so and every time I have to google the command and its syntax. Would be helpful so SQL Prompt recognised and helped with these and other inbuilt procedures and their parameters, for example:
spattachsinglefiledb
sp_helptext
spattachdb
23 votesIn 6.4 we always provide intellisense for system stored procedures if the query is being run against master.
If you’re running against a normal db then we hide the system stored procedures by default as they clutter the suggestions list. There’s a couple ways to get around this, either by qualifying with “sys.” or using the “List system objects” option. A video on this can be found here https://www.youtube.com/watch?v=i8DOTmHkKo8
-
Share Snippets
Add the ability to change the snippet file folder location so as to share snippets between users,or machines for the same user. Of course the change would also need to check the folder for new snippets on startup and at the request of the user, the latter being important for those of us who leave ssms running for long periods.
23 votesWe’ve released SQL Prompt 6 which includes the option to specify where snippets are stored.
-
Allow renaming of variables easily
In the T-SQL editor it'd be really good if you could rename variables easily. In VS, if you use Resharper clicking on a variable and hitting F2 allows you to rename that variable and all occurrences of it easily. It even searches strings and comments and offers these as an option
22 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
"commarise"
When copying a list of items from something like Excel, it would be lovely to have a feature in Prompt which would highlight the list, hit a key stroke and it would place quotes around each item and a comma after them.
It would stop me bashing the quote + arrow + comma keys at the speed of light.
22 votesThis is included in SQL Prompt 7 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Column aliases alignment
Allow alignment of column aliases in a Select statement.
22 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Suggestions missing for longer T-SQL code
I have some longer Stored Procs and other T-SQL code and it appears that after some number of lines between the declaration of a variable, table, etc., and its subsequent usage, SQL Prompt no longer suggests the object.
I would have sworn there was an option that I could configure to say how many lines of code to look-back for declared objects.
Can we get that back?
22 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Insert Statement Highlighting Column and Value
Assume that I have an INSERT statement such as:
INSERT INTO dbo.MyTable (Column1, Column2, Column3)
VALUES ('Apple','Orange','Grape');If the mouse pointer is in the word 'Apple', the text Column1 should be highlighted in some way. This will help the user clearly see the alignment of which field they are in. If I move my cursor over to 'Orange', the text Column2 should then be highlighted. This is a very simple example, but sometimes I deal with queries with dozens of columns and it's a chore just to find which value in the bottom of the query corresponds to which value…
21 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
SQL PROMPT 5 - Simple, but toggle indenting of else if statements
Allow the option to NOT indent else if statements. Each of the ELSE IF statements gets further indented and for large SQL it becomes indented off the screen. I can imagine this pattern could apply else where but for this specific use case our STPs that have this condition i simply can't format the sql because it requires me to horizontally scroll. Allowing me to disable indenting ELSE IF statements would solve this problem instantly.
21 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
suggestion box is sometimes in the way
The intellisense box often obscures data in the grid results payne which requires that I hit esc to close suggestions and then retype or ctrl-space to bring it back up.
Possible solutions:
1) The main reason is that the box is usually much larger than it needs to be. If it would auto size as needed it would take up much less room.
2) an optional transparency setting would be much appreciated. Initially draw the box opaque but when the user stops typing, start fading it out a bit slowly because the user may want to see content below. The…
21 votesTransparency was added as an option in SQL Prompt 9.4.10.
-
Unwrap sp_executesql
Frequently I need to debug application generated SQL obtained via Profiler. Parameterized queries are often implemented with sp_executesql.
I love using Format SQL to make a single line monster query into something I can actually read. But when it's stuck in an spexecutesql call the format function doesn't touch it. I have to:
Remove "Exec spexecutesql".
Remove the apostrophes around the query SQL. For big queries this is really painful, especially if the query itself contains apostrophes.
Remove the apostrophes around the parameter defenitions.
Move the parameter definitions to the top and add a DECLARE.
Move the parameter…18 votesThis feature was released in version 7.3 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team -
Query Tab Coloring based on instance and database
As for now, it appears that query tab coloring only is based on instance. In smaller environments, it is not uncommon to see for instance both production, test and stage in the same instance. As for now, Query Tab Coloring does not work very well in such scenarios.
18 votesThis is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Autoformat should not indent begin
Instead of
IF xxx
BEGIN
sss
sss
ENDIt should format as
IF xxxx
BEGIN
ssss
ssss
ENDfor all cases where begin and end are used.
18 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Support for SQL CMD Mode
Please add support for SQL CMD mode. When SSMS is in SQL CMD mode, SQL Prompt pretty much becomes disabled when :setvar is used to define an object (e.g. table) name. Thus, in the code:
:setvar mytable "dbo.mytable"
select * from $(mytable)SQL Prompt is of no use. SQL Prompt should be able to resolve $(mytable) to the base object.
17 votesThis is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
- Don't see your idea?