Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update if exist and insert if it doesn't
Message
 
À
12/08/2001 05:48:38
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00542663
Message ID:
00543254
Vues:
13
Actually, I take care of this in a different way:

UPDATE... WHERE...
If @@ROWCOUNT = 0
INSERT....


>>You can't do it in one instruction. Here's my perfered method:
>>
>>if exists (select * from mytable where keyfield=keyvalue)
>> update ...
>>else
>> insert
>>
>>-Mike
>
>Thanks Mike.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform