Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a trigger on an audit table may cause multiple ent
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01198853
Message ID:
01199553
Views:
14
Thank you. That did the job! :)


>I don't think it's safe to use "select *" in a insert statement.
>
>Try this instead:
>
>CREATE TRIGGER [QPRCopy] ON dbo.QPR
>FOR INSERT, UPDATE
>AS
>
>BEGIN
>	INSERT INTO QPRAudit
>	   SELECT Field1, field2.... FROM Inserted
>END
>
>
>
>>No, I do not have any code like that. This should be fun! Well, maybe not too much fun. :)
>>
>>>Maybe trigger is disabled with
>>>ALTER TABLE...DISABLE TRIGGER
?
>>>
>>>>This is it.
>>>>
>>>>
>>>>CREATE TRIGGER [QPRCopy] ON dbo.QPR
>>>>FOR INSERT, UPDATE
>>>>AS
>>>>
>>>>BEGIN
>>>>	INSERT INTO QPRAudit
>>>>	SELECT * FROM Inserted
>>>>END
>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform