Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Cascade FK values from VFP?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01537208
Message ID:
01537237
Vues:
23
>>go
>>begin transaction
>> update Salaries set EmpNo = NULL where EmpNo = 'Test1'
>> update Employee set EmpNo = 'Test32' where EmpNo = 'Test1'
>> update Salaries set EmpNo = 'Test32' where EmpNo = 'Test1'
>>commit transaction
>>
>>You should either have CASCADE relation or set the FK value to NULL first. Otherwise it's a "catch 22" situation.
>
>Well.. Cascade in SQL Server does not always work. In case of my database it does not work in a lot of places. So I had to implement it using my own code. I suppose I will have to remove/delete all FK constraints then.
>Thank you.

What about the code I showed? I don't recommend to get rid of constraints as you may end up with orphans in such case.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform