189 results found
-
Expand a view or views referenced in a query
I think it would be great if SQL Prompt had the functionality to expand a view that is used in a query. So if you have this schema:
CREATE TABLE dbo.Person
(
PersonID INT IDENTITY(1, 1)
PRIMARY KEY,
LastName VARCHAR(30),
FirstName VARCHAR(30),
);
GOCREATE TABLE dbo.Student
(
StudentID INT IDENTITY(1, 1)
PRIMARY KEY,
PersonID INT,
StudentNo VARCHAR(100)
);
GOCREATE TABLE dbo.Class
(
ClassID INT IDENTITY(1, 1)
PRIMARY KEY,
ClassName VARCHAR(100)
);
GOCREATE TABLE dbo.ClassRoster
(
ClassID INT,
StudentID INT
);GO
CREATE VIEW dbo.Students
AS
SELECT
S.StudentID,
P.LastName,
P.FirstName,
S.StudentNo
FROM
dbo.Person AS P
JOIN dbo.Student AS…17 votes -
Format SQL Code on opening file
It would be awsome if there was an option that would format an SQL Script automatically after opening it in SSMS / VS. So if you load a file it would be formatted automatically with your selected formatting style. It would be great too if this auto format option could be switched on and off in the Options.
17 votes -
Replace all tabs with spaces
Setting the option to use spaces instead of tabs for intending (our house policy) only works for new tab presses.
I would like a simple action that would replace all tabs in the current document with spaces -- using the tab-to-spaces value as set in options. Sublime Text has this and I use practically every time I edit anything.57 votes -
16 votes
-
Convert code to dynamic Code
Convert selected CODE or a complete stored procedure to Dynamic SQL Code.
16 votes -
Template based formatting with different
Template based formatting.
Select your text and right click, format according to template... then select the appropriate template of your choice.8 votes -
Auto generated INSERT needs a column blacklist
Add the ability to exclude columns from appearing in the auto-generated INSERT statements. I have to manually remove certain columns every time.
9 votes -
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~~~~~~~~~~~~~;27 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
- Don't see your idea?