Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update command deletes record
Message
 
To
12/07/2005 11:27:51
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
C# 1.1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01031669
Message ID:
01031745
Views:
16
Keith,

Thank you for the reply. We are using SQL Server 2003. When I go into the option for Managing Triggers for each of the tables I don't see any. As far as the RunCommand goes, here is the code:
private static void RunCommand(String cmd)
{
	int TimeoutSecs = 480;
	try
	{
		TimeoutSecs = System.Int32.Parse(Common.Application("SQLCommandTimeoutSecs"));
	}
	catch {}
	DB.ExecuteLongTimeSQL(cmd,TimeoutSecs);
}
I'm sorry to be ignorant but I can't find the Process Info in Enterprise Manager.

This is odd. This shopping cart is a 3rd party product I purchased so I'm not sure if it would be a good idea for me to remove the dependencies. Or, maybe you don't think this has anything to do with it anyway.

Thanks again,
Paul


>Paul,
>
>Dependencies are not particularly reliable in SQL Server 2000 and are fairly meaningless. Your problem of an UPDATE causing a row to be deleted can happen if there is an UPDATE trigger on the ShoppingCart table. It is also possible that the code that implements RunCommand is deleting the record.
>
>Immediately after executing the RunCommand, check the Process Info in Enterprise Manager (EM..[INSTANCE]..Management..Current Activity..Process Info). It will show you the last T-SQL command that was executed which will show what the RunCommand() method is actually sending to SQL Server.
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform