Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update command deletes record
Message
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Update command deletes record
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01031669
Message ID:
01031669
Vues:
57
The first 2 commands work as expected. The third command actually deletes the record it should be updating.
RunCommand("update product set SKU = " + Common.SQuote(Sku) + " where ProductID = " + ProductID);
RunCommand("update Orders_ShoppingCart set OrderedProductSKU = replace(OrderedProductSKU," + Common.SQuote(OldSku) + ","+Common.SQuote(Sku)+") where ProductID = " + ProductID);
RunCommand("update ShoppingCart set ProductSKU = replace(ProductSKU," + Common.SQuote(OldSku) + ","+Common.SQuote(Sku)+") where ProductID = " + ProductID);
I am new to SQL Server and I am using a database that I purchased for an online store.

Anyway, I started playing around in Enterprise Manager and I chose to Display Dependancies.

I noticed that Product doesn't have any dependencies, Orders_ShoppingCart is dependant on Orders, and ShoppingCart is dependant on Product.

Is the fact, that ShoppingCart is dependant on Product and that I changed Product first, the reason?

If this is the case is there a way to remove the dependency and then make the updates and then replace the dependency. I guess I don't understand what a dependency is for.

Thank you,
Paul
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform