|
-
Oct 18th, 2011, 01:33 AM
#1
Thread Starter
Junior Member
[RESOLVED] create trigger
Hi Everybody i want to create trigger in sql server 2008 database
i want to insert data into another table in same database after parent database inserted record
i am trying something like this
CREATE TRIGGER INS_LOGDATA
ON NGAC_AUTHLOG
AFTER
INSERT
(select Userid,Transactiontime from NGAC_AUTHLOG )
AS Insert into LOGDATA values (Userid,ActDate,ActTime) values (Userid,ActDate,ActTime)
Last edited by deshpandesn; Oct 18th, 2011 at 01:40 AM.
Reason: additional information
-
Oct 18th, 2011, 02:25 AM
#2
Re: create trigger
Thread moved to the 'Database Development' forum
-
Oct 19th, 2011, 10:12 AM
#3
Re: create trigger
It would be something like this:
INSERT LOGDATA(Userid,ActDate,ActTime)
select Userid,Transactiontime,ActTime from inserted
You'll need to resolve the column names from inserted (which are what is in NGAC_AUTHLOG) to the names in LOGDATA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|