Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a trigger on an audit table may cause multiple ent
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01198853
Message ID:
01199553
Vues:
16
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
>>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform