SQL Prompt Not Providing Suggestions for Placeholders in Quotes

Hello,

I am currently using SQL Prompt version 10.14.21.9884 with SQL Server Management Studio 20.1.10.0 and I’ve encountered an issue that I hope can be addressed.

The problem is that SQL Prompt does not seem to provide suggestions for placeholders when they are enclosed in quotes. I’m not sure if this is a bug or if I’m doing something wrong.

Is there a solution to this issue? Is it possible for SQL Prompt to provide suggestions for placeholders even when they are enclosed in quotes? Or is this a known bug that will be fixed in a future update?

Any help or guidance would be greatly appreciated.

Thank you in advance.

Best regards, 

Stefan






Answers

  • Good Afternoon Stefan,

    Thanks for reaching out to Redgate Support regarding your Prompt question and for providing the exact version you are utilizing. I am not aware of any limitation for Prompt providing suggestions for placeholders however placeholders are typically utilized for column names rather than table names as you are using in your example unless you are using dynamic sql.

    Could you share the TSQL used for declaring @Tabellen so I can mimic the same conditions from your environment?
  • _Stefan__Stefan_ Posts: 4 New member
    edited June 25, 2024 5:30AM
    Hello @cperez,

    Thank you for your quick response.
    I use dynamic SQL.

    This is the TSQL:
    DECLARE @SchlüsselFeld NVARCHAR(100);
    DECLARE @sql NVARCHAR(MAX);
    DECLARE @Kommentar NVARCHAR(MAX);
    DECLARE @Datum NVARCHAR(50);
    DECLARE @Autor NVARCHAR(100);
    
    DECLARE @Tabellen TABLE (
        TabellenName NVARCHAR(100)
    );
    
    -- Fügen Sie den/die Tabellennamen hinzu
    INSERT INTO @Tabellen (TabellenName)
    VALUES ('[schema].[table_name]');DECLARE @TabellenName NVARCHAR(100);
    
  • _Stefan__Stefan_ Posts: 4 New member
    edited June 25, 2024 5:39AM
    Hello @cperez,

    Thank you for your quick response.
    I use dynamic SQL.

    This is the TSQL:
    DECLARE @TabellenName NVARCHAR(100);
    DECLARE @SchlüsselFeld NVARCHAR(100);
    DECLARE @sql NVARCHAR(MAX);
    DECLARE @Kommentar NVARCHAR(MAX);
    DECLARE @Datum NVARCHAR(50);
    DECLARE @Autor NVARCHAR(100);
    
    DECLARE @Tabellen TABLE (
        TabellenName NVARCHAR(100)
    );
    
    INSERT INTO @Tabellen (TabellenName)
    VALUES ('[schema].[table_name]');
    

  • Hello _Stefan,

    Thanks for following up with the dynamic SQL I requested. I found that in my testing I was having suggestions returned back whenever I switched the single quotes to double quotes such as "[schema].[tab le_name]" . (Most database systems also allow for double quotes) Could I have you try this and let me know if you run into any issues?
  • _Stefan__Stefan_ Posts: 4 New member
    edited July 2, 2024 6:16AM
    Hello @cperez,

    Unfortunately, it doesn't work with double quotes. I believe double quotes are not allowed in SQL Server.
    Is there another option to fix this problem?


Sign In or Register to comment.