What are the challenges you face when working across database platforms? Take the survey
Options

OVER (ORDER BY) breaks suggestions and code formatting

PerSPerS Posts: 3 New member
edited April 8, 2022 8:11AM in SQL Prompt
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

Answers

  • Options
    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
  • Options
    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
  • Options
    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
  • Options
    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
  • Options
    PerSPerS Posts: 3 New member
    edited April 27, 2022 11:20AM
    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?
Sign In or Register to comment.