Logon Triggers Not Supported

ggeierggeier Posts: 30 Bronze 2
I am unable to use SQL Prompt's autocomplete features within a logon trigger. Is there any way this can be supported?

Example:
use master
go
create trigger [trgAudit]
on all server
for logon
as
begin
	-- can't declare any @vars using autocomplete
	declare @var int = 1

	-- can't write an IF statement, like below
	if (@var = 1)
		begin
			select 1
		end
end
Tagged:

Comments

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for your post!

    My apologies, can you please provide more detail on where/what autocomplete is missing? (I didn't spot any issues from a quick test, though I may be misunderstanding!)

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • ggeierggeier Posts: 30 Bronze 2
    The autocomplete isn't showing up inside the logon trigger. The only suggestions that come up are from snippets.
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks @ggeier!

    Just to make sure I'm understanding correctly, do you mean for example that typing
    declare @var i
    

    doesn't show a suggestion for 'int'?

    I can't reproduce this at the moment, but can I please check what versions of the tool you're on? If you're not on the latest version, v8.0.7.1917, can you please try updating to see if the problem persists?

    If you are already on the latest, does the problem persist if you disable and then re-enable suggestions from the SQL Prompt menu?

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • ggeierggeier Posts: 30 Bronze 2
    edited August 10, 2017 4:03PM
    It doesn't autocomplete any keywords inside the trigger. So suggestions for "declare" or "int" aren't showing. I am on the latest version of SQL Prompt (8.0.8.2086, just upgraded today). The problem also occurred on 8.0.7.1917.

    I disabled and re-enabled suggestions and the problem persists.

    edit: Here are two screenshots that show the autocomplete inside an SP working, but not working inside the trigger.

    SP:
    yqh6ldlit1hx.png

    trigger:
    cwe3uxaxswbs.png
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks @ggeier! I don't know what's changed, but I actually am able to reproduce this now. I'm looking into it, please bear with me.

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi there,

    I've confirmed that logon triggers are not supported at the moment and we have logged a bug for this with reference SP-6562.

    I'll post here once we have an update on a fix.

    Thanks again for pointing this out, @ggeier!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for your patience on this @ggeier!

    I'm happy to report that this is resolved in the latest version of SQL Prompt (8.0.9.2226), available from Help>Check for updates.

    I hope that helps but please let us know if you see any other issues with this!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • ggeierggeier Posts: 30 Bronze 2
    Great, thanks!
Sign In or Register to comment.