Comments
Sort by recent activity
It's still an issue (I posted about it earlier). If you format (and expand wildcards) : WITH CTE1 AS ( SELECT *, a+b as ab FROM #TempTable), CTE2 AS ( SELECT *, c+d as cd FROM CTE1) SELECT * FROM CTE2 It becomes:
WITH CTE1 AS (SELECT *, a + b AS ab FROM #TempTable),
CTE2 AS (SELECT CTE1.ab, c + d AS cd FROM CTE1)
SELECT CTE2.ab, CTE2.cd FROM CTE2; The other * columns from #TempTable aren't returned in the final output
/ comments
It's still an issue (I posted about it earlier). If you format (and expand wildcards) :WITH CTE1 AS (SELECT *, a+b as ab FROM #TempTable), CTE2 AS (SELECT *, c+d as cd FROM CTE1)SELECT * FROM CTE2I...
The reason I feel it deserves to be prioritized is that it causes existing working code not to work. As a first step in editing code (code I did not write myself) I run it through the SQL Prompt Formatter. I can no longer trust that the code will work after expanding wildcards, so I cannot use this feature at all until the issue is resolved. And yes, this has already caused an issue. I commit the code in source control after running it through the formatter, so that formatting changes can be reviewed separately from functional changes in code. If the SQL Prompt formatter is making functional changes this methodology breaks down. / comments
The reason I feel it deserves to be prioritized is that it causes existing working code not to work. As a first step in editing code (code I did not write myself) I run it through the SQL Prompt Fo...
Also, on a related note, how do you turn the _querytext column in data.Cluster_SqlServer_TopQueries_Instances into plain text? / comments
Also, on a related note, how do you turn the _querytext column in data.Cluster_SqlServer_TopQueries_Instances into plain text?
I am already aware of that method, and have used it in the past. That method works well when a particular query is already on my radar. What I'd like is more along the lines of a report that lists the top 10 queries and stored procedures whose average duration has increased over the last week. I don't want to click individually on each top 50 query I suspect may have gotten worse over time. And again, I am mainly concerned about relative performance, queries whose performance has slipped, not just the top 50 now. / comments
I am already aware of that method, and have used it in the past. That method works well when a particular query is already on my radar. What I'd like is more along the lines of a report that lists ...
Thanks for the utils.GZipToString. I should be able to use this to build my own query. I am still hopeful that there is a feature built into the product that can do this, or will be in the future. / comments
Thanks for the utils.GZipToString. I should be able to use this to build my own query. I am still hopeful that there is a feature built into the product that can do this, or will be in the future.
Do you mean that everything inside the BEGIN and END blocks has no indentation? I have been seeing this as well. / comments
Do you mean that everything inside the BEGIN and END blocks has no indentation? I have been seeing this as well.
Unfortunately, every object in the database (1000+) has already been formatted with the format file that I sent you, with an earlier version of RedGate SQL Prompt 9.x that didn't have this error. Since the database is under source control it isn't a trivial matter to reformat, the original formatting took weeks and caused a lot of merge conflicts. Please pass this issue on to the RedGate SQL Prompt support team so that they can determine which version it started breaking in, why, and determine how to fix it. / comments
Unfortunately, every object in the database (1000+) has already been formatted with the format file that I sent you, with an earlier version of RedGate SQL Prompt 9.x that didn't have this error. S...
This is still an issue in 9.2.9. Here is an example with multiple BEGIN statements: BEGIN
BEGIN
BEGIN
IF @Country = 'USA' BEGIN
SET @FormatCode = 1;
END;
ELSE BEGIN
SET @FormatCode = 2;
END;
END;
END;
END;As you can see, the SET statements have no indentation at all. I would like to automate style checks around the style guide I posted, but until this error is addressed we cannot, since it would undo the manual fixes around this problem. / comments
This is still an issue in 9.2.9. Here is an example with multiple BEGIN statements:BEGIN
BEGIN
BEGIN
IF @Country = 'USA' BEGIN
SET @FormatCode = 1;
END;
ELSE BEGIN
SET @FormatCode = 2;
...
This is part of a stored procedure. I only cut out the place where RedGate SQL Prompt was failing to produce expected results. So the whole thing was indented at least once from the BEGIN / END around the entire PROC, and likely indented again since I believe it was in an IF BEGIN / END block as well. This also used to work as expected in a previous version of SQL Prompt, in that the statements enclosed in the BEGIN / END statements aligned with the N in the BEGIN (one tab over) Here is a sample from the last working SQL Prompt version: IF dbo.DATEONLY(@EndDate) = dbo.MONTHEND_DATEONLY(@EndDate)
BEGIN
IF @StartDate IS NULL SET @StartDate = DATEADD(mm, -3, dbo.MONTHBEGIN(@EndDate));
END;
ELSE BEGIN
IF @StartDate IS NULL SET @StartDate = DATEADD(dd, -1, @EndDate);
END;Well at least it looks correct in SSMS, where a tab is equivalent to 4 spaces. / comments
This is part of a stored procedure. I only cut out the place where RedGate SQL Prompt was failing to produce expected results. So the whole thing was indented at least once from the BEGIN / END aro...