184 results found
-
Align aliases, commas, datatypes and expressions at the next tab stop
I align aliases, commas, datatypes and expressions at the first tab stop following the longest element in the list. See examples below:
-- Tilde character used as space replacement to cope with HTML formatting
-- 2-character tabs are assumed below
-- In a fixed-space font, the commas, = signs, data types and AS keywords would all line up vertically
DECLARE
~~@x~~~~~~~~~~~~~~INT~~~~~~~~~,
~~@var~~~~~~~~~~~~VARCHAR(4)~~,
~~@longer_varname~VARCHAR(10)~,
~~@z~~~~~~~~~~~~~~DATETIME~~~~;SELECT
~~~~@longer_varname~=~'x'~~~~~~~,
~~~~@var~~~~~~~~~~~~=~'1234'~~~~,
~~~~@z~~~~~~~~~~~~~~=~GETDATE()~;SELECT
~~~~T1.shortfield~~~~~~~~AS~ShortField~,
~~~~AO.reallylongfield~~AS~LongField~~,
~~~~'x'~~~~~~~~~~~~~~~~~~~AS~XChar~~~~~~,
~~FROM~~~~~~~~dbo.table1~~~~~~AS~T1
~~~~LEFT~JOIN~dbo.anotherone~AS~AO~ON~T1.keyval~=~AO.keyval;EXEC~@x~=~dbo.SomeProc
~~@Param1~=~'3'~~~~~~~~~~~,
~~@P2~~~~~=~'Longer~Text'~,
~~@P3~~~~~=~4~~~~~~~~~~~~~;26 votes -
warn against data truncation
I would be nice if SQL-prompt could warn against posible data truncation.
Like assigning a int value to a tinyint field/variable or assigning a varchar(30) to a varchar(3).
I want it both at an global analysis (like find invalid objects) and in the current scrip edit (while modifying a trigger / procedure / function).13 votes -
prevent Prompt SQL from destroying bookmarks
If format SQL makes chnages - it destroy saved marks
This occurs even when line bookmarked line hasnt (visibly) changed
Very frushtrating3 votes -
Place space before END when collapsing shorter case statements
When collapsing CASE expressions shorter then XXX, the END has no space if there is a preceding parenthesis.
Example1 = CASE t1.Col004 WHEN 1 THEN t1.Col006 END,
Example1 = CASE t1.Col004 WHEN 1 THEN TRY_CONVERT(int, t1.Col006)END,0 votes
- Don't see your idea?