Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trigger is locking up record
Message
De
29/04/2004 08:54:08
 
 
À
29/04/2004 06:39:58
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00899034
Message ID:
00899290
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>So I could use a cursor?

While you could use a cursor, it would not be recommended. Remember that the trigger will be called for each INSERT and UPDATE against the table. You don't want to do anything that would inject a long running process. Your best solution would be one that is set based:

INSERT INTO table2 (...) VALUES (...)
SELECT ... FROM inserted i INNER JOIN table1 t1 ON t1.id = i.id

>> Except for transfering the data over from the old DB, the data will be entered by hand, in a data entry mode.

I'd also recommend disabling the triggers while doing the load. Duplicate the processing of the trigger into your ETL process.

-Mike


>So I could use a cursor? Except for transfering the data over from the old DB, the data will be entered by hand, in a data entry mode. I am glad for that information. Thank You.
>
>I have continued testing, and still am unable to find why the table is locking. I have tried different ways of doing the same thing, i.e. making variables in the if...else and then doing the insert/update later in the code based on those variables etc., but nothing seems to work. The ID field entry must exist, because I can do a select and get it, but the table seems to lose it somehow. I am at a loss.
>
>The trigger is an 'AFTER' trigger, so the table entry would have to exist before the trigger would fire. Any thoughts on what could be causing the table to lose it?
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform