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

Getting error in SQL Prompt

I ran the SQL server profiler and copied the following query from there and pasted it in SSMS editor. Immediately, the first line of the SP call below was having green squiggly.  

EXEC [sys].[sp_executesql] N'[dbo].[ProcedureName] @parameter1, @parameter2, @parameter3, @parameter4',
                           N'@parameter1 int,@parameter2 int,@parameter3 datetime,@parameter4 datetime',
                           @parameter1 = 1,
                           @parameter2 = 2,
                           @parameter3 = '2019-01-1 00:00:00',
                           @parameter4 = '2019-01-1 00:00:00';

After that I got a warning bulb as shown below (right side). When I click on "use named parameters", I get the error message (left side).




I am not sure what is the expected behaviour here? Is it supposed to automatically fix it? or just notify me?
vsha041
0

Comments

2 comments

  • Sergio R
    If the lightbulb symbol on the left is orange it can auto-fix it (it still requires you ask it to do so), if it's blue it is just advisory.

    https://documentation.red-gate.com/sp/sql-code-analysis

    So in your case, it should have fixed it without displaying another error message

    This appears to be an occurrence of bug SP-7761

    I will advise you when this is fixed or there are other updates.
    Sergio R
    0
  • Sergio R
    This has been fixed, if you're experiencing this issue please update to the latest version of SQL Prompt
    Sergio R
    0

Add comment

Please sign in to leave a comment.