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

Logon Triggers Not Supported

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
ggeier
0

Comments

8 comments

  • Jessica R
    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 R
    0
  • ggeier
    The autocomplete isn't showing up inside the logon trigger. The only suggestions that come up are from snippets.
    ggeier
    0
  • Jessica R
    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 R
    0
  • ggeier
    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
    ggeier
    0
  • Jessica R
    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 R
    0
  • Jessica R
    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 R
    0
  • Jessica R
    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 R
    0
  • ggeier
    Great, thanks!
    ggeier
    0

Add comment

Please sign in to leave a comment.