I am trying to create a triger for insert. I would like to get id into log table id data was inserted.What am I doing incorrect:
if exists (select * from dbo.sysobjects where id = object_id('dbo.mstr_update')
and OBJECTPROPERTY(id, 'IsTrigger') = 1)
drop trigger dbo.mstr_update
GO
CREATE TRIGGER dbo.mstr_Log ON mstr_new
FOR INSERT
AS
Begin
SELECT ID,Getdate()
Into mstr_Log
FROM mstr_new
if exists (select * from dbo.sysobjects where id = object_id('dbo.mstr_update')
and OBJECTPROPERTY(id, 'IsTrigger') = 1)
drop trigger dbo.mstr_update
GO
CREATE TRIGGER dbo.mstr_Log ON mstr_new
FOR INSERT
AS
Begin
SELECT ID,Getdate()
Into mstr_Log
FROM mstr_new