Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Tracking "Insert into"

Author  Topic 

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2013-02-25 : 00:56:43
Hi,
I have a sql server 2008R2, i have provided a login someone within a domain with write-only access, now I want to trigger a sql server agent job whenever a "insert into" query sucessfully executed by that login.

please help in this regard.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-25 : 01:05:52
do you mean you need to do trigger action only for specified login?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2013-02-25 : 01:20:26
Yes

How to do it in SQL Server 2008, if you have any example then it will be appriciated.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-25 : 02:01:48
nope. you can do that

however what you can do instead is to add a trigger and do a check inside to see if login is your required login and then do corresponding actions.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2013-02-25 : 02:03:58
I have created a trigger but the insert command is not working when trigger is active ... unable to figure it out why it is happening.

Any one please help, i am new in triggers.
Go to Top of Page

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2013-02-25 : 02:16:15
Following are the lines if i modify the trigger, if this is active than the insert into command is not working.

USE [DB NAME]
GO
/****** Object: Trigger [dbo].[SMSC] Script Date: 02/25/2013 12:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[DB NAME]
ON [dbo].[tABLE NAME]
AFTER INSERT
AS
BEGIN

END
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-25 : 04:10:12
what is active? didnt get that part.

i cant see any insert into command also

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -