How can we help you today? How can we help you today?

OVER (ORDER BY) breaks suggestions and code formatting

The following T-SQL breaks suggestions and formatting in SQL Prompt. There are no suggestions for #temp and val is not qualified when formatting.

CREATE TABLE #temp
(
    val int NOT NULL
);

SELECT val,
       LAG(val) OVER (ORDER BY val) AS prev_val
  FROM #temp AS t;

The following two code blocks do not break suggestions and formatting:

CREATE TABLE #temp
(
    val int NOT NULL
);

SELECT val,
       /** LAG(val) OVER (ORDER BY val) **/ NULL AS prev_val
  FROM #temp AS t;

CREATE TABLE #temp
(
    val int NOT NULL
);

SELECT val,
       MAX(val) OVER () AS max_val
  FROM #temp AS t;

SQL Prompt version: 10.11.9.27382
SSMS version: 18.11.1
PerS
0

Comments

5 comments

  • dkim1999
    Hi there,

    Thank you for reaching out and I apologize that you are running into issues with SQL Prompt.

    I have not been able to recreate your issue on my end. Can you provide some steps on how you are receiving the error?

    Thank you!
    David Kim
    Product Support Engineer
    dkim1999
    0
  • dkim1999
    Hi there,

    Thank you for reaching out and I apologize that you are running into issues with SQL Prompt.

    I have not been able to recreate your issue on my end. Can you provide some steps on how you are receiving the error?

    Thank you!
    David Kim
    Product Support Engineer
    dkim1999
    0
  • dkim1999
    Hi there,

    Thank you for reaching out and I apologize that you are running into issues with SQL Prompt.

    I have not been able to recreate your issue on my end. Can you provide some steps on how you are receiving the error?

    Thank you!
    David Kim
    Product Support Engineer
    dkim1999
    0
  • dkim1999
    Hi there,

    Thank you for reaching out and I apologize that you are running into issues with SQL Prompt.

    I have not been able to recreate your issue on my end. Can you provide some steps on how you are receiving the error?

    Thank you!
    David Kim
    Product Support Engineer
    dkim1999
    0
  • PerS
    I realize now that the issue is only present when I'm connected to a Synapse database (other than master). Not when connected to a local SQL Server database.

    Are you able to recreate the issue on your end when connected to Azure Synapse?
    PerS
    0

Add comment

Please sign in to leave a comment.