May 16, 2013 at 3:25 am
Hi ALl
I am trying to fire a trigger when I am trying to excute the statement : SELECT * INTO Table_BACKUP from TABLE
Defined a AFTER INSERT trigger on TABLE_BACKUP but its not doing anything?
CAn you please help?
Meghna
May 16, 2013 at 3:35 am
SELECT INTO creates a new table and requires that the table specified in the INTO does not exist, hence I struggle to see how you've defined a trigger on a table that won't exist until after the select into runs
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
May 17, 2013 at 3:34 pm
GilaMonster is correct about the Select Into. But if you are trying to create an insert trigger after an insert into a table in most other ways there are numerous examples of how to build that trigger.
SOmething like the normal
CREATE TRIGGER myAfterInsertTrigger
ON mytable
AFTER INSERT
AS
...
GO
Not all gray hairs are Dinosaurs!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply