This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have a few tables related to Transaction table. When I deleted the record 1 from transaction table, I have to check each and every table weather it has a record based on 1 or not. If it is first I want to deleted from all the child tables then parent table.
Could some one please help me to write the query regarding this. I really apprciate it.
Thanks in advance --Prathyusha |
|
|
Normally LightSpeed's cascade delete feature will handle this for you when you delete the parent, so you don't need to write the query at all. If you do need to do it manually, then you need something like: int txnid = 1; // or whatever or: unitOfWork.Remove(new Query(typeof(Weather), Entity.Attribute("TransactionId") == txnid); The latter bypasses in memory entities, the L2 cache, etc. and should only be used for bulk processing -- do not mix it with entity processing (see http://www.mindscapehq.com/documentation/lightspeed/Performance-and-Tuning/Bulk-Updates-and-Deletes for more info). |
|