August 27, 2015 at 11:10 am
Hi all,
I have server level logon event trigger which should run a proc if I create a login. But this is not getting executed. This is running in my local server but not in QA server. IN my QA server I am sysadmin in sql server.
Thanks
"More Green More Oxygen !! Plant a tree today"
August 27, 2015 at 11:37 am
we'd have to see your trigger. is your trigger enabled? is it referencing the procedure by full path, ie master.dbo.yourproc?
Lowell
August 27, 2015 at 11:41 am
Hang on...
A logon trigger fires when someone logs in to the server, not when a login is created. You'd need a server-scope DDL trigger to fire on CREATE LOGIN. Which do you have?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 28, 2015 at 7:21 pm
I am having DDL trigger with server scope. The same trigger gets executed on a local box with 2014 without AAG configured , but If I ran the code on QA box with AAG configured this trigger does not work. Please find the trigger script attached.
The trigger get fired each time we create a login on SQL Server and the trigger will call a proc to add the login info in a table with SID and PWD.
I am facing issue when I ran the same code on QA with AAG configured.
"More Green More Oxygen !! Plant a tree today"
August 28, 2015 at 7:30 pm
How about the code for the proc...testme.[dbo].[addlogin]?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 30, 2015 at 9:23 pm
it adds the new logins in the table with create date. The same trigger am testing on local it is working but not firing on QA client box. Do you think this might be due to permission issue?
USE [testme]
GO
/****** Object: StoredProcedure [dbo].[addlogin]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[addlogin] @lv_obj_name varchar(500)
AS
Begin
IF len(@lv_obj_name) >0
begin
insert into [testme].[dbo].[Login_tab]
values (@lv_obj_name,GETDATE())
--print ' added to login table';
end
Else
Begin
print 'NULL value added'
end
end
"More Green More Oxygen !! Plant a tree today"
August 31, 2015 at 10:54 am
Minaz Amin (8/30/2015)
[dbo].[addlogin][testme].[dbo].[Login_tab]
We presume these objects exist and you are not getting any sort of error message?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply